[+!![]]+[+![]]+[+!![]]: [] - , . ![], , , !![] . +true , 1. +![] 0 false.
[-~!![]+-~!![]-~!![]]: ~- operator with two additions; ~1- -2. Thus, it is evaluated as -(-2)+-(-2)+-(-2), which is equal 6.
The remaining additions are similar.
array + arrayconverts arrays to strings; this way [1]+[0]+[1]+[6]...will give a string"1016..."
Plus, at startup, converts it to a number.
source
share