Can anyone help me with this JavaScript expression?
+[[+!![]]+[+![]]+[+!![]]+[-~!![]+-~!![]-~!![]]+[-~!![]]+[+![]]+[+!![]]+[-~!![]+-~!![]]]
A friend sent it to me and asked me to copy and paste it in the browser console.
This is the result:
10162014
If anyone could explain this to me or at least point me to right references please. Thanks!
Answer
First break out your code to this: !![] which returns true (!! is to convert to boolean) and now + converts to number so +!![] returns 1.
![] converts to false so +![] returns 0.
~[] returns -1 and ~![] also returns -1.
~!![] returns -2.
Now, -~!![] returns 2 and -~![] returns 1.
So, combining them all returns 10162014.
All about you to know is ~, !, +, & -
No comments:
Post a Comment