单项选择题
function test(){
var a=20;
alert(a);
setTimeout(function(){
a=30;
alert(a);
},2000);
alert(10);
}
test();以上代码的弹出顺序是( )
A.20,10,30
B.20,20,10
C.20,10,20
D.20,30,10
点击查看答案
相关考题
-
单项选择题
function Animal(){}在Animal的原型上扩展一个type的属性,值为’动物’,扩展一个say的方法,用于打印type属性,正确的实现方法是()
A.Animal.prototype.type=”动物”;Animal.prototype.say=function(){console.log(this.type)});
B.Animal={type:”动物”,say:function(){console.log(this.type)}
C.Animal.prototype({type:”动物”,say:function(){console.log(this.type)})
D.以上说法都不正确 -
单项选择题
在list元素内部末尾添加元素,以下正确的是()
A.appendChild
B.appendChildren
C.insertAfter
D.insertBefore -
单项选择题
box.onclick = function() { setTimeout(function() { console.log(this) }) }以上代码运行结果为()
A.window
B.box
C.undefined
D.程序报错
