📌  相关文章
📜  如何在特定索引处将项目插入数组 JavaScript 代码示例

📅  最后修改于: 2022-03-11 15:04:26.145000             🧑  作者: Mango

代码示例3
var arr = [];
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
arr[3] = "Kai Jim";
arr[4] = "Borge";

console.log(arr.join());
arr.splice(2, 0, "Lene");
console.log(arr.join());