remove first element from array and return the array minus the first element

后端 未结 5 1393
温柔的废话
温柔的废话 2021-01-31 01:09



        
5条回答
  •  佛祖请我去吃肉
    2021-01-31 01:33

    Why not use ES6?

     var myarray = ["item 1", "item 2", "item 3", "item 4"];
     const [, ...rest] = myarray;
     console.log(rest)

提交回复
热议问题