以下语句是正确的变量声明语句的是()。
A: var name = "张三" ;
B: var null = 123 ;
C: var name = "张三",age = 18 ;
D: var name , age ;
A: var name = "张三" ;
B: var null = 123 ;
C: var name = "张三",age = 18 ;
D: var name , age ;
举一反三
- 以下能够创建一个对象的是( )。 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: "张三" } ) ;
- 下面四个变量声明语句,哪一个变量的命名是正确的? A: var true B: var my_name C: var my name D: var 2cat
- 访问如下json对象中的name属性的方式是:var stu={name:"张三",age:20} A: stu[name] B: stu.name C: stu->name D: this.name
- 以下关于字符串变量的声明不正确的是? A: var myText = "my name is zhangsan"; B: var myText = 'my name is zhangsan'; C: var myText = 'my name is zhangsan"; D: var myText = "my name is\t zhangsan";
- 在javascript中,执行后输出的结果是: var name="zhaonan"; var obj1={ name:"miao", age:20, say:function(){ console.log(this.name); } } var obj2={ name:"xue", age:30, say:function(){ console.log(this.name); } } var f=obj2.say; console.log(f()); var e=f.bind(obj1); console.log(e()); var k=e.bind(obj2); console.log(k()); A: zhaonan zhaonan miao B: zhaonan miao miao C: zhaonan miao xue D: miao zhaonan xue