📜  js unshift vs push - Javascript代码示例

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

代码示例1
//My Opinion is really nothing. They are the same exept one adds a element
//to the end and the other one adds a element to the front
//    Push Method
var array = [2];//your random array
array.push(3)
//    Unshift Method
array.unshift(1)