[译]Javascript quiz
原文:http://asenbozhilov.com/articles/quiz.html
这些题目都源自ECMA-262-3规范.Good luck!
译者注:作者是根据ES3出的题,但我没发现和ES5有不同表现的地方.暂时不给出答案解释.请到http://ecma-international.org/ecma-262/5.1/找答案
-
Function.prototype.toString.call({
name: 'F',
body: 'print("Javascript is hard")'
}); -
new String({
toString : function (){ return this;},
valueOf : function () {return this;}
}); -
typeof (new Date() + new Date());
-
typeof (void null);
-
function F() {}
F.prototype = new Function;
Object.prototype.toString.call(new F()); -
[].length = -2;
-
var D = Math.pow(2, 33);
(D | D) == D; -
'_string_'.replace(/^/, "$'");
-
eval('typeof F; function F() {}');
-
debugger;