Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cache = {};
- function Manager() {}
- Manager.protoype.coin = function() { return 'coin coin'; }
- var old = Manager.protoype.coin;
- Manager.protoype.coin = function() {
- if (!cache.coin) {
- cache.coin = old();
- }
- return cache.coin;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement