You can do everything in Javascript with six characters: []()!+


#1

Originally published at: https://boingboing.net/2017/10/16/you-can-do-everything-in-javas.html


#2

You can do everything in binary with two characters: 01


#3

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.


#4

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.


#5

2 characters, not two instructions.


#6

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.


#7

AND and NOT should be enough


#8

You know where this leads, don’t you?

"JavaScript … imperfections … sterilize … "


#9

It seems like more work.


#10

One thing you can’t do with only six characters: write readable code.


#11

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.


#12

I can do everything in your username with 5 characters.


#13

I’m filing away the obvious “your mom” variant of that diss for future use.


#14

It is like trying to break into a computer in Fallout


#15

You can do everything in assembler.


#16

Isn’t that true of regular JS as well?


#17

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!


#18

I can name that tune in zero notes, Jim.


#19

I interviewed the creator (discoverer?) of JSFuck, Martin Kleppe, about this and his other projects here


#20

Yeah, but you can use those characters to find someone to write readable code.