Re:Return True to Win
by sladix on Friday August 12, 2016 @10:19AM
(#12275822)
Does someone have a <52 char solution for the counter one ?
[ Parent
| on HN ]
(x=0)=>()=>++x
You can save one character by doing this:
(x=0)=>_=>++x
the underscore is another variable but a single variable does not require parenthesis. So instead of two chars for the two parens, you use a single char for a single letter variable. JS FTW ;)
that's ascii art, not code
Holy crap, that's what I call refactoring !
One solution:
function(c=1){return function(){return c++}}
44 characters