單項選擇題

(function(){
var foo;
console.log(typeof foo);
function foo(){}
foo = "foo";
})();打印結(jié)果是()

A.function
B.undefined
C.string
D.object


您可能感興趣的試卷

你可能感興趣的試題

2.單項選擇題function Animal(){}在Animal的原型上擴展一個type的屬性,值為’動物’,擴展一個say的方法,用于打印type屬性,正確的實現(xiàn)方法是()

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.以上說法都不正確