r/javascript • u/Nitrosyllium • Oct 26 '24
AskJS [AskJS] A fun line of code I wrote using JavaScript's coersion
console.log(((!![]+[])+!![]+![])[+!+[]+[+!+[]]]+([][[]]+[])[+[]]+([![]]+({}+[]))[+!+[]+[+[]]]+([![]]+({}+[]))[+!+[]+[+[]]]+({}+[])[+!+[]]+([][[]]+[])[+!+[]]+([][[]]+[])[!![]+!![]]+([!![]]+[][[]])[+!+[]+[+!+[]]]+([!![]]+[][[]])[+!+[]+[+!+[]]]+((!![]+[])+!![]+![])[+!+[]+[+!+[]]]+([][[]]+[])[+!+[]]+([][[]]+[])[+[]]+([]+!![])[+[]]+((!![]+[])+!![]+![])[+!+[]+[+!+[]]]);
3
u/InTheEndEntropyWins Oct 26 '24
succondeesnuts
((!![]+[])+!![]+![]) = truetruefalse
[+!+[]+[+!+[]]] = [11]
'truetruefalse'[11]=s
And so on.
0
u/Ronin-s_Spirit Oct 27 '24
Ok? I can make a binary buffer iterable with inconspicuous read and write syntax for each iteration.
I cal also tell an array to be coerced to a number, where it will be multiplying all its number values together to produce a single number.
My reaction is mild because somebody wrote jsfuck and made a compiler for it before you.
1
u/Exceptionally-Mid Oct 31 '24
You are the arrogant programmer stereotype
3
u/Ronin-s_Spirit Oct 31 '24 edited Nov 01 '24
You don't understand do you? There's like a million videos doing this but better. Completely unimpressive, I'm not saying I'm amazing, I'm saying he did nothing of interest.
P.s. there's literally a compiler built for this out of vanilla javascript, and it will let you write anything without even thinking about it.
24
u/jessepence Oct 26 '24
Ahh, I can tell that you're new to this because you actually typed out "console.log". Oh, sweet summer child, it can get so much worse.
Welcome to JSFuck.