下面哪一个字符串变量定义语句是不正确的?
A: var mytext = "Here is some text!"
B: var mytext = 'Here is some text!'
C: var mytext = 'Here is some text!"
D: var mytext = "Here is\nsome text!"
A: var mytext = "Here is some text!"
B: var mytext = 'Here is some text!'
C: var mytext = 'Here is some text!"
D: var mytext = "Here is\nsome text!"
举一反三
- 以下关于字符串变量的声明不正确的是? 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";
- 如果对象的名称为Mytext,而且对象有一个属性Text,那么在代码中引用该属性的正确 A: Text.Mytext B: Mytext.Text C: Mytext.(Text) D: Mytext*Text
- 以下哪段代码能正确创建函数show() A: var showFun = new function{"text","alert(text)"}; B: function show(text){alert(text);} C: var showFun = function show(text){alert(text);} D: var showFun = function(text){alert(text);}
- 下面的代码: var person = {fname:'Bill', lname:'Gates', age:62}; var text = ''; for (var x in person) { text += person[x]; } 循环结束后,text的值为:( )
- 下面的代码: var person = {fname:'Bill', lname:'Gates', age:62}; var text = ''; for (var x in person) { text += person[x]; } 循环结束后,text的值为:( )