3 ms·
Does someone have a <52 char solution for the counter one ?
by sladix 10y ago
Does someone have a <52 char solution for the counter one ?
- nikital 10y agoOne solution: function(c=1){return function(){return c++}} 44 characters
- curveship 10y ago(x=0)=>()=>++x
- sladix 10y agoHoly crap, that's what I call refactoring !
- posterboy 10y agothat's ascii art, not code
- awalGarg 10y agoYou 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 ;)
- deleted 10y ago[deleted]
- Bahamut 10y agoi=>_=>i=-~i