让人蛋疼的JavaScript语法特性(2)
A. "undefined"
B. "object"
C. "number"
D. "function"
答案:A
8.
var f = (function f() {
return "1";
}, function g() {
return 2;
})();
typeof f;
A. "string"
B. "number"
C. "function"
D. "undefined"
答案:B
9.
var x = 1;
if (function f() {}) {
x += typeof f;
}
x;
A. 1
B. "1function"
C. "1undefined"
D. NaN
答案:C
10.
var x = [typeof x, typeof y][1];
typeof typeof x;
A. "number"
B. "string"
C. "undefined"
D. "object"
答案:B
11.
(function (foo) {
return typeof foo.bar;
})({
foo: {
bar: 1
}
});
A、“undefined”
B、“object”
C、“number”
D、Error
答案:A
12.
(function f() {
function f() {
return 1;
}
return f();
function f() {
return 2;
}
})();
A、1
B、2
C、Error (e.g. “Too much recursion”)
D、undefined
答案:B