标签:return var nbsp iam john hello str bsp log
var arr = [‘George‘,‘John‘,‘Thomas‘,‘James‘,‘Adrew‘,‘Martin‘]
console.log(arr)
arr.splice(2,0,"William")//[George,John,William,Thomas,James,Adrew,Martin]
console.log(arr)
return [George,John,William,Thomas,James,Adrew,Martin]
var str="Hello world!"
console.log(str.indexOf("Hello"))//0
console.log(str.indexOf("world"))//6
console.log(str.indexOf("World"))//-1
console.log(str.indexOf("m"))//-1
return index(索引)
标签:return var nbsp iam john hello str bsp log
原文地址:http://www.cnblogs.com/alan-alan/p/7210082.html