Originally published at: https://boingboing.net/2017/10/16/you-can-do-everything-in-javas.html
…
You can do everything in Javascript with six characters: []()!+
I’m not seeing how to program in only 2 characters. P’’ seems about as small as it gets.
https://en.wikipedia.org/wiki/P′′ I’d be interested how to do it in only 2.
Oh sweet Goddess! I can’t wait 'til someone replaces js.node with the JSFuck version. Epic pwnage when someone’s website tries to get you to download a 20 gig javascript file that is just there for analytics.
Should I be alarmed that my browser displayed a dialog that said “good luck and good night” when I viewed this article? Does Internet Explorer 4 do that too? Maybe I should upgrade.
Bah. The only serious esoteric language is Piet, which does all that in six colors.
Okay, three shades each of six colors. Plus black and white. Point being, it’s prettier so it’s better.
MAPPING is full of win.
't': '(true+"")[0]',
'u': '(undefined+"")[0]',
'v': '(+(31))["to"+String["name"]](32)',
'w': '(+(32))["to"+String["name"]](33)',
'x': '(+(101))["to"+String["name"]](34)[1]',
'y': '(NaN+[Infinity])[10]',
'z': '(+(35))["to"+String["name"]](36)',
'A': '(+[]+Array)[10]',
'B': '(+[]+Boolean)[10]',
'C': 'Function("return escape")()(("")["italics"]())[2]',
'D': 'Function("return escape")()([]["fill"])["slice"]("-1")',
'E': '(RegExp+"")[12]',
'F': '(+[]+Function)[10]',
'G': '(false+Function("return Date")()())[30]',
'H': USE_CHAR_CODE,
'I': '(Infinity+"")[0]',
I think I see a pattern!
I interviewed the creator (discoverer?) of JSFuck, Martin Kleppe, about this and his other projects here