MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1j1cw7/coffeescripts_scoping_is_madness/cbagf6u/?context=3
r/programming • u/donatj • Jul 25 '13
315 comments sorted by
View all comments
Show parent comment
2
Yes. That code is equivalent to
var counter1; counter1 = (function() { var i = 0; return function() { return i++; }; })();
which is what you wanted, I think. As far as I know you cannot write CoffeeScript that compiles to the above javascript exactly.
View all comments
Show parent comment
2
u/rwbarton Jul 26 '13
Yes. That code is equivalent to
which is what you wanted, I think. As far as I know you cannot write CoffeeScript that compiles to the above javascript exactly.