#JavaScript Challenge: write a function x so that:
x `Codegolf` ` ` `and #` `JS` `!` ``;
returns:
"Codegolf and #JS!"
(my impl is 54B)
-
-
@avlidienbrunn I never said it couldn't have side effects, so I guess I'll have to accept that :) A lot shorter than my solution! -
@peterjaric@avlidienbrunn Simply shortened: y="";x=z=>z[0]?(y+=z,x):y -
@peksa@peterjaric@avlidienbrunn y="";x=z=>z[y+=z,0]?x:y -
@filedescriptor@peterjaric@avlidienbrunn 21 without side effects: x=a=>b=>b[0]?x(a+b):a -
@peksa@filedescriptor@avlidienbrunn Wow. Equivalent to my solution, I think, but much shorter! :) Can it get any better? -
@peksa@filedescriptor@avlidienbrunn My 54 (actually 53) solution: x=(a)=>a[a.length-1]==''?a.join``:(b)=>x([...a,...b]) -
@peterjaric@filedescriptor@avlidienbrunn Looks the same yes! .join`` is a neat trick that I'll remember.. :) - End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.