颤憟吧,凡人! / Shock, Motals!
//IE, FF, Opera, GC
function(){
alert("hello!");
}();
//x,x,o,x
function(){
alert("hello!");
}.call();
//x,x,o,x
(function(){
alert("hello!");
}());
//o,o,o,o
var a = function(){
alert("hello!");
}();
//o,o,o,o
//语法问题
alert(eval("{}"));
//x,x,x,x
alert(eval("({})"));
//o,o,o,o
//语法问题
alert(eval("function(){}"));
//x,x,o,o
alert(eval("(function(){})"));
//x,o,o,o
alert(eval("[function(){}][0]"));
//o,o,o,o
//应该是BUG
("l".a)();
//o,o,o,o
"l"["a"]();
//o,o,o,o
//和"l".a()等价
Author:优雅的神棍 / Elegant Tales
神棍你好,神棍再见。

发表留言