function getCounter() { var myCount = 0; return function() { return myCount++; } }
counter = getCounter();
> counter(); 0 > counter(); 1
Post a Comment
No comments:
Post a Comment