下列方法中,能正确创建 JavaScript 对象的是( )。
A: var txt = new Object[name:"George",price:25]
B: var txt = new Object(name:"George",price:25)
C: var txt = new Object{name:"George",price:25}
D: var txt = new Object({name:"George",price:25})
A: var txt = new Object[name:"George",price:25]
B: var txt = new Object(name:"George",price:25)
C: var txt = new Object{name:"George",price:25}
D: var txt = new Object({name:"George",price:25})
举一反三
- 下列方法中,能正确创建 JavaScript 对象的是( )。 A: var txt = new Object[name:"George",price:25] B: var txt = new Object(name:"George",price:25) C: var txt = new Object{name:"George",price:25} D: var txt = new Object({name:"George",price:25})
- 以下能够创建一个对象的是( )。 A: var obj=new Object( ) ; B: var obj=function(name){this.name=name ; }<br> var p1=new obj( "张三" ) ; C: var obj={ name : "张三" ; } D: var obj=Object.create( { name: "张三" } ) ;
- 下列JavaScript定义对象的语句中,()不正确。 A: var person = {}; B: var person = new Object(); C: person =name; D: function person(name,sex){} var personObj = new person();
- 一条支路中一般只含一个电阻或一个电源。(function () { var pb_blacklist = []; var pb_whitelist = ["6pm.com","oa.zjpc.net.cn","engage.wixapps.net","linkedin.com","google","www.gmail.com","www.pinterest.com","www.youtube.com","www.facebook.com","search.yahoo.com","chrome://newtab","www.food.com"]; function inject() { var
- 下列哪个是文件域表单元素正确的写法?( ) A: <input type="file" name="file" /> B: <input type="button" name="btn" /> C: <input type="text" name="text" /> D: <input type="password" name="pwd" />