连接url:http://perfectionkills.com/javascript-quiz
/* var a = (function() { return typeof arguments; })(); alert(a); //Object var b = (function(x) { delete x; return x; })(); alert(b); //undefined //********************** var f = function g() { return 23; typeof g(); } alert(f); //function。。。。 //******************************** var y=1, x = y = typeof x; x; alert(x);//undefined alert(x = y = typeof x);//string //******************************** var g = (function f(f) { return typeof f(); })(function() { return 1; }); alert(g); //number //************************************** var foo = { bar: function() { return this.baz;}, baz: 1 }; var g = (function() { return typeof arguments[0](); })(foo.bar); alert(g); //undefined //**************** var foo = { bar: function(){ return this.baz; }, baz: 1 } alert(typeof (f = foo.bar)()); //********************************************* var f = (function f(){ return "1"; }, function g(){ return 2; })(); alert(typeof f); //number var x = 1; if (function f(){}) { x += typeof f; alert(x); } alert(x); //1number //alert(function g() {}); //**************************************** function f() { return f; } alert(new f() instanceof f); //false //***************************************** var g = (function f(){ function f(){ return 1; } return f(); function f(){ return 2; } })(); alert(g); //2 //******************************************** var k = (function(foo){ return typeof foo.bar; })({ foo: { bar: 1 } }); alert(k); //undefined //****************************************** var x = [typeof x, typeof y][1]; alert(typeof typeof typeof x); //string //****************************************** with (function(x, undefined){}) alert(length); //2 */ var j = (function(x){ delete x; return x; })(1); alert(j); //1
时间: 2024-10-14 21:58:57