r/programming • • Aug 10 '12

Write any javascript code with just these characters: ()[]{}+!

http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
1.3k Upvotes

288 comments sorted by

View all comments

-3

u/wickedhood Aug 10 '12

The website doesn't work. It just freezes when you try to convert a script.

16

u/nemec Aug 10 '12

How large of a script are you converting?

alert(1) becomes

[][(![]+[])[!+[]+!![]+!![]]+({}+[])[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]]({}+[])[!+[]+!![]+!![]+!![]+!![]]+{}+[])[+!![]]+([][+[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][+[]]+[])[+[]]+({}+[])[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+({}+[])[+!![]]+(!![]+[])[+!![]][!+[]+!![]+!![]]+([][+[]]+[])[!+[]+!![]+!![]])()(({}+[])[+[]])[+[]]+(!+[]+!![]+!![]+[])+{}+[])[!+[]+!![]]))()

So I imagine a larger script will take a while to convert.

-3

u/stumac85 Aug 10 '12

Exactly - I don't get the point of this whatsoever! Is it meant to be useful?!

4

u/Nodules Aug 10 '12

What does it matter? The dude who made this found it fun/interesting to do so, and that's what matters.

Of course it isn't particularly useful. No-one in their right mind would use this for production (or even development) code. He did it because he could.