原创 JavaScript常用數組操作方法

push() 往數組末尾添加任意多個元素 var arr = ['1', '2']; arr.push('3'); console.log(arr); // ["1", "2", "3"] unshift() 往數組開