Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getScorer(init) {
- var i = init;
- return function(amount) {
- i += amount;
- return i;
- };
- }
- var addToScore = getScorer(5);
- debug(addToScore(2));
- debug(addToScore(4));
- debug(addToScore(7));
- debug(addToScore(1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement