js常用的数组堆栈操作函数,pop,shift,push,unshift
来源:原创
时间:2015-08-26
作者:脚本小站
分类:JS/JQuery
向数组的前后添加或删除元素
pop 移除数组的最后一个元素,并将其返回 shift 移除所数组第一个元素,并将其返回 push 将元素添加到数组最后一个 unshift 将元素添加到数组第一个
pop 移除数组的最后一个元素,并将其返回 shift 移除所数组第一个元素,并将其返回 push 将元素添加到数组最后一个 unshift 将元素添加到数组第一个