题目内容:
25. 声明一个对象,给它加上name属性和show方法显示其name值,以下代码中正确 的是( )。(本题2.0分)
A A. varobj = [name:"zhangsan",show:function(){alert(name);}];B B. varobj = {name:"zhangsan",show:”alert(this.name)”};
C C. varobj = {name:"zhangsan",show:function(){alert(name);}};
D D. varobj = {name:"zhangsan",show:function(){alert(this.name);}};
参考答案: