3 ms·
I'm a fan of Javascript. It has proper lambdas, true lexical scope, will soon have TCO, and is a really flexable language. But it's not without its warts, and
by qwertyuiop924 10y ago
I'm a fan of Javascript. It has proper lambdas, true lexical scope, will soon have TCO, and is a really flexable language.
But it's not without its warts, and this is one of the worst. Although it's sometimes fun to mess with, nonetheless.
To see this taken to one of its logical extremes, check out If Hemmingway Wrote Javascript's entry for Douglas Adams:
// Here I am, brain the size of a planet, and they ask me to write JavaScript...
function kevinTheNumberMentioner(_){
l=[]
/* mostly harmless --> */ with(l) {
// sorry about all this, my babel fish has a headache today...
for (ll=!+[]+!![];ll<_+(+!![]);ll++) {
lll=+!![];
while(ll%++lll);
// I've got this terrible pain in all the semicolons down my right hand side
(ll==lll)&&push(ll);
}
forEach(alert);
}
// you're really not going to like this...
return [!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]];
}
- digi_owl 10y agoThat reads like a close cousin of brainfuck...
- qwertyuiop924 10y agoexactly
- djsumdog 10y agoFor those of you too lazy to open up a Javascript console, it's a function that returns "42".
- qwertyuiop924 10y agoIt also alerts all the primes between 0 and its arg.
- frostymarvelous 10y agoFor those not in the know or too lazy to Google, that's "the answer to life the universe and everything"
- MyNameIsFred 10y agoOr too lazy to work it out in your head. Jeez.
- z3t4 10y agoLexical scope with async closures makes it very easy to write async code for example events in a gui or handling multiple clients in a server. Its a big deal.