题目:声明一个对象,包含name属性和show()方法,以下代码中正确的是()。
A. var obj = [name:"zhangsan",show:function(){alert(name);}];
B. var obj = {name:"zhangsan",show:"alert(this.name)"};
C. var obj = {name:"zhangsan",show:function(){alert(name);}};
D. var obj = {name:"zhangsan",show:function(){alert(this.name);}};
答案:评论后可见此内容