A: 9
B: 2
C: 7
D: 10
举一反三
- 以下代码的输出结果是?var str='abc';var b=new Boolean(str)console.log(b) A: true B: abc C: false D: 0
- 执行下面代码,输出的结果是( )var str = "12em";var s = str.indexOf("2");console.log(s) A: 1 B: 2 C: e D: 12
- var arr = [5,3,2,4]; var res = arr.splice(0); console.log(res) 如上代码运行的结果是 A: [5,3,2,4] B: [5] C: [5,3] D: [2,4]
- var str = "Helloworld" var re = str.charAt(5) console.log(re) 请问输出的结果为
- var str = "Hello world" var re = str.indexOf("h") console.log(re) 请问输出的结果为
内容
- 0
以下代码var str=100.00;console.log(parseInt(str))输出结果正确的是()。 A: 1 B: 100.0 C: 10.00 D: 100
- 1
5.4字符串测试3:有一个段代码:var str = "hello world";var i = str.lastIndexOf("w");window.alert(i);消息框输入的结果是: A: 7 B: 6 C: 5 D: 4
- 2
代码的输出结果是var str = ''; for(var b = 1;b < 11;b ++){ str += 'helloworld<br>'; } document.write(str); A: helloworld B: helloworld<br> C: 输出10个helloworld D: 输出10个helloworld<br>
- 3
在JavaScript中,把字符串“123”转换为整型值123的正确方法是( )。 A: var str="123";var num=(int)str; B: var str="123";var num=str.parseInt(str); C: var str="123";var num=parseInt(str); D: var str="123";var num=Integer.parseInt(str);
- 4
在JavaScript中,把字符串“789”转换为整型值789的正确方法是() A: var<br/>str="789"; var num=(int)str; B: var<br/>str="789";var num=str.parseInt(str); C: var<br/>str="789";var num=parseInt(str); D: var<br/>str="789";var num=Integer.parseInt(str);