Recently I came across an interesting website that illustrates a Javascript Obfuscator: http://bl.ocks.org/jasonsperske/5400283
For example, (([]===[])+/-/)[1]
gives a
and (1+{})[(1<<1)+1]
gives b
.
I have tried hard to understand the evaluation sequence of these obfuscated result but was in vain.
Taking (1+{})[(1<<1)+1]
as an example, I understand that <<
is the bitwise shift operator and will return 2, so the expression becomes (1+{})[3]
. But then I cannot understand what does it mean by 1+{}
and [3]
.
Google isn't really helpful to this problem as search engines don't like the brackets or slashes very much, so in case there are duplicate questions I'm sorry about that.