// Variable declarations
_=[]|[];
$=_++;
__=(_<<_);
___=(_<<_)+_;
____=__+__;
_____=__+___;
// Variable declarations that "do stuff"
$$=({}+"")[_____]+({}+"")[_]+({}[$]+"")[_]+(($!=$)+"")[___]+(($==$)+"")[$]+(($==$)+"")[_]+(($==$)+"")[__]+({}+"")[_____]+(($==$)+"")[$]+({}+"")[_]+(($==$)+"")[_];
$$$=(($!=$)+"")[_]+(($!=$)+"")[__]+(($==$)+"")[___]+(($==$)+"")[_]+(($==$)+"")[$];
$_$=({}+"")[_____]+({}+"")[_]+({}+"")[_]+(($!=$)+"")[__]+({}+"")[__+_____]+({}+"")[_____]+({}+"")[_]+({}[$]+"")[__]+(($==$)+"")[___];
// Final function call
($)[$$][$$]($$$+"('"+$_$+"')")()
扩展声明 1
// Variable declarations
// _=[]|[]; -> replace `_` with 0
$=0; // (actually, 1)
__=(1<<1); // 2
___=(1<<1)+1; // 3
____=2+2; // 4
_____=2+3; // 5
// Variable declarations that "do stuff"
$$=({}+"")[_____]+({}+"")[1]+({}[0]+"")[1]+((0!=0)+"")[___]+((0==0)+"")[0]+((0==0)+"")[1]+((0==0)+"")[__]+({}+"")[_____]+((0==0)+"")[0]+({}+"")[1]+((0==0)+"")[1];
$$$=((0!=0)+"")[1]+((0!=0)+"")[__]+((0==0)+"")[___]+((0==0)+"")[1]+((0==0)+"")[0];
$_$=({}+"")[_____]+({}+"")[1]+({}+"")[1]+((0!=0)+"")[__]+({}+"")[__+_____]+({}+"")[_____]+({}+"")[1]+({}[0]+"")[__]+((0==0)+"")[___];
// Final function call
(0)[$$][$$]($$$+"('"+$_$+"')")()
扩展声明 2
变量的更多扩展,让我们评估那些 0==0 和 0!=0s。
// Variable declarations that "do stuff"
$$=({}+"")[5]+({}+"")[1]+({}[0]+"")[1]+((false)+"")[3]+((true)+"")[0]+((true)+"")[1]+((true)+"")[2]+({}+"")[5]+((true)+"")[0]+({}+"")[1]+((true)+"")[1];
$$$=((false)+"")[1]+((false)+"")[2]+((true)+"")[3]+((true)+"")[1]+((true)+"")[0];
$_$=({}+"")[5]+({}+"")[1]+({}+"")[1]+((false)+"")[2]+({}+"")[2+5]+({}+"")[5]+({}+"")[1]+({}[0]+"")[2]+((true)+"")[3];
// Final function call
(0)[$$][$$]($$$+"('"+$_$+"')")()
// Variable declarations that "do stuff"
$$=("[object Object]")[5]+("[object Object]")[1]+("undefined")[1]+("false")[3]+("true")[0]+("true")[1]+("true")[2]+("[object Object]")[5]+("true")[0]+("[object Object]")[1]+("true")[1];
$$$=("false")[1]+("false")[2]+("true")[3]+("true")[1]+("true")[0];
$_$=("[object Object]")[5]+("[object Object]")[1]+("[object Object]")[1]+("false")[2]+("[object Object]")[2+5]+("[object Object]")[5]+("[object Object]")[1]+("undefined")[2]+("true")[3];
// Final function call
(0)[$$][$$]($$$+"('"+$_$+"')")()
并且,将([0] 和 [1] 等)索引到这些字符串中:
$$="c"+"o"+"n"+"s"+"t"+"r"+"u"+"c"+"t"+"o"+"r";
$$$="a"+"l"+"e"+"r"+"t";
$_$="c"+"o"+"o"+"l"+" "+"c"+"o"+"d"+"e";
// Final function call
(0)[$$][$$]($$$+"('"+$_$+"')")()
并结合:
$$="constructor";
$$$="alert";
$_$="cool code";
// Final function call
(0)[$$][$$]($$$+"('"+$_$+"')")()