js实现数组的上下移动

思路:上移表示index索引位置减去1,下移表示index索引位置增加1。使用数组的splice方法实现。例如上移:splice('元素当前索引位置',1(删除1个元素),‘元素当前索引位置 - 1’)。

猜你喜欢

转载自blog.csdn.net/weixin_45313351/article/details/134591589