This link explains very well how this javascript code works:
http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
:
, , - :
[] -
+[] === 0 , 0
!+[] === true false
!+[]+!+[] === 2 true + true. 1, . , .
, ?
[]+{} === "[object Object]" , ({}) , , ([]).
([]+{})[+!+[]] === "o", , ("abc"[1] == "b").
10 , . , :
"undefined" === [][+[]]+[] ( undefined ),
"NaN" === +{}+[] ( ),
"true" === !![]+[],
"false" === ![]+[]
, . , , btoa (btoa base64), ASCII.
- :
[]["sort"]["constructor"]("OUR_CODE")()
, . , Function. . , ()