The JavaScript syntax characteristics of the human egg pain _ Basics

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.