js中怎么在數(shù)組中間插入一個(gè)數(shù)?
var fruits = ["Banana", "Orange", "Apple", "Mango"]
;fruits.push("Kiwi"
)//在數(shù)組末尾追加kiwifruits.splice(2,0,"Lemon","Kiwi")
;//在數(shù)組第二位置添加元素你可以看一下菜鳥(niǎo)教程里面,關(guān)于js的教程,搜索javascript數(shù)組就行了
js中怎么在數(shù)組中間插入一個(gè)數(shù)?
var fruits = ["Banana", "Orange", "Apple", "Mango"]
;fruits.push("Kiwi"
)//在數(shù)組末尾追加kiwifruits.splice(2,0,"Lemon","Kiwi")
;//在數(shù)組第二位置添加元素你可以看一下菜鳥(niǎo)教程里面,關(guān)于js的教程,搜索javascript數(shù)組就行了