to remove first and last element in array

后端 未结 12 793
鱼传尺愫
鱼传尺愫 2020-12-04 16:14

How to remove first and last element in an array?

For example:

var fruits = [\"Banana\", \"Orange\", \"Apple\", \"Mango\"];

Expecte

12条回答
  •  无人及你
    2020-12-04 16:34

    To remove element from array is easy just do the following

    let array_splited = [].split('/');
    array_splited.pop()
    array_splited.join('/')
    

提交回复
热议问题