下面不是用于创建一个新的对象的语句是
A: var d = new Date();
B: var f = ();
C: var o = new Object();
D: var o = {title: "hello", author: "Tom"};
A: var d = new Date();
B: var f = ();
C: var o = new Object();
D: var o = {title: "hello", author: "Tom"};
举一反三
- Date对象问题4:Date对象正确获取年份的方法是: A: var now = new Date();var year = now.Year(); B: var now = new Date();var year = now.getYear(); C: var now = new Date();var year = now.getFullYear(); D: var now = new Date();var year = now.getNowYear();
- 关于创建日期类下列说法正确的是( ) A: var now:Date = new Date(); B: var now:timer = new Timer (); C: var now: date = new date(); D: var now:timer = new Timer ();
- 以下( )语句不能创建数组。 A: var myarray = new Array ; B: var myarray = new Array(5); C: var myarray=new Array("hello" ,"hi","greetings"); D: var myarray = new Array[10];
- 以下能够创建一个对象的是( )。 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: "张三" } ) ;
- Date对象问题3:能获得当前日期的是: A: var now = Date.now(); B: var now = new Date(); C: var now = new Date(now); D: var now = Now();