Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var cache = {};
  2. function Manager() {}
  3.  
  4. Manager.protoype.coin = function() { return 'coin coin'; }
  5.  
  6. var old = Manager.protoype.coin;
  7.  
  8. Manager.protoype.coin = function() {
  9.     if (!cache.coin) {
  10.         cache.coin = old();
  11.     }
  12.     return cache.coin;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement