0

Why does this

([]+![])[+!+[]]

becomes

a

in Javascript?

is there any link or some explanations about this? any links would be great!

I've seen links as provided but, it only seems to answer the Numeric Part. Yet, I cant seem to grasp as to why would these ([]+![])[+!+[]] translates or equates to a

Reyn
  • 757
  • 1
  • 5
  • 16
  • 1
    http://stackoverflow.com/q/9032856/218196 and lots of other similar questions. – Felix Kling Feb 14 '17 at 06:03
  • Ummm its a number(the link), but this one is about character. which is confusing, thanks for the link though @FelixKling – Reyn Feb 14 '17 at 06:06
  • 6
    `![]` is `false`, `[]+false` becomes `""+false` and is `"false"`. `+[]` becomes `+""` and is `0`. `!0` is `true`, `+true` is `1` and `("false")[1]` is `"a"` – Thomas Feb 14 '17 at 06:11
  • 1
    Figuring this out is unlikely to be of any use whatsoever to you or anyone else, unless you plan to participate in some JavaScript trivia competition. –  Feb 14 '17 at 06:55

0 Answers0