In the knowledge of some of the published and JavaScript-related questions, and share with you, although it is n long ago, but these questions are quite classic, it is inevitable that JavaScript is really a pain in the door of the language.
1.
Copy Code code as follows:
(function () {
return typeof arguments;
})();
A. "Object"
B. "Array"
C. "Arguments"
D. "Undefined"
Answer: A
2.
Copy Code code as follows:
var f = function g () {
return 23;
};
typeof G ();
A. "Number"
B. "Undefined"
C. "Function"
D. Eorror
Answer: D
3.
Copy Code code as follows:
(function (x) {
Delete x;
return x;
}) (1);
A. 1
B. Null
C. undefined
D. Error
Answer: A
4.
Copy Code code as follows:
var y = 1,
x = y = typeof x;
X
A. 1
B. "Number"
C. undefined
D. "Undefined"
Answer: D
5.
Copy Code code as follows:
(function f (f) {
Return typeof F ();
}) (function () {
return 1;
});
A. "Number"
B. "Undefined"
C. "Function"
D. Error
Answer: A
6.
Copy Code code as follows:
var foo = {
Bar:function () {
return This.baz;
},
Baz:1
};
(function () {
Return typeof Arguments[0] ();
}) (Foo.bar);
A. "Undefined"
B. "Object"
C. "Number"
D. "Function"
Answer: A
7.
Copy Code code as follows:
var foo = {
Bar:function () {
return This.baz;
},
Baz:1
};
typeof (F = foo.bar) ();
A. "Undefined"
B. "Object"
C. "Number"
D. "Function"
Answer: A
8.
Copy Code code as follows:
var F = (function f () {
return "1";
}, function g () {
return 2;
})();
typeof F;
A. "String"
B. "Number"
C. "Function"
D. "Undefined"
Answer: B
9.
Copy Code code as follows:
var x = 1;
if (function f () {}) {
x + + typeof F;
}
X
A. 1
B. "1function"
C. "1undefined"
D. NaN
Answer: C
10.
Copy Code code as follows:
var x = [typeof x, typeof y][1];
typeof typeof X;
A. "Number"
B. "String"
C. "Undefined"
D. "Object"
Answer: B
11.
Copy Code code as follows:
(function (foo) {
return typeof Foo.bar;
})({
Foo: {
Bar:1
}
});
A, "undefined"
B, "Object"
C, "number"
D, Error
Answer: A
12.
Copy Code code as follows:
(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
Answer: B
13.
Copy Code code as follows:
function f () {
return F;
}
New F () instanceof F;
A, True
B, False
Answer: B
14.
Copy Code code as follows:
With (function (x, undefined) {}) length;
A, 1
B, 2
C, undefined
D, Error
Answer: B
15.
Copy Code code as follows:
Which of the following statements produces a run-time error: ()
A.var obj = ();
B.var obj = [];
C.var obj = {};
D.var obj =//;
Answer: A