I realize that this is intended as a joke, but someone posted this and it alerts "fail" in the browser, what is going on that makes this happen?
alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]);
I realize that this is intended as a joke, but someone posted this and it alerts "fail" in the browser, what is going on that makes this happen?
alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]);
Here is a good blog post about this topic: http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
You basically create strings ("false","undefined" and others) and again use addition of true's to get the indexes.
For example the first letter (f):
(![]+[])[+[]]
You use ![]
to get false, and add []
to convert it into a string. The content within the parenthesis is now "false". You then access it like an array, and ´+[]` converts to 0 (false as a number).