一些语法盲点整理

 

1.var a=new Number(10);var b=10;以下代码和返回值匹配的是

A typeof a;//Number

B typeof b;//number

C a instanceof Number//true

D b instanceof Number//false

2.function A(a){var b = 'b';return a(a);}console.log(A(function(){return this;}))运行结果是啥

A "a"

B "b"

C A{}

D window{}

3.a=2;function fn(a){a=a+2}fn(a);alert(a);结果是

A "a"

B 2

C 4

D "undefined"

4.(1)var a;console.log(typeof a==undefined);(2)var a;console.log(typeof a===undefined)

A (1)flase (2)true

B (1)true (2)true

C (1)true (2)false

D (1)false (2)false

5.var a={};function fn(a){a={b:2}};fn(a);alert(a.b)

A 报错"b is not defind"

B 2

C undefined

D 报错'b is not a propty of null'

6.下列关于原型说法测试代码返回false的是正确的是

A function fn(){};console.log(fn.__proto__==Object.prototype)

B console.log(Function.__proto__.__proto__==Object.prototype)

C console.log(Object.__proto__==Function.prototype)

D console.log(fn.__proto__==Function.prototype)



A D B D C A

回到顶部

你可能感兴趣的:(js每日测验)