📅  最后修改于: 2022-03-11 15:03:49.777000             🧑  作者: Mango
var arr = [];
arr[0] = "Apple";
arr[1] = "Grape";
arr[2] = "Pear";
arr[3] = "Peach";
arr[4] = "Grapefruit";
console.log(arr.join()); // Apple,Grape,Pear,Peach,Grapefruit
arr.splice(2, 0, "Orange");
console.log(arr.join()); // Apple,Grape,Orange,Pear,Peach,Grapefruit