how to remove elements of array?

前端 未结 4 1443
情话喂你
情话喂你 2020-12-29 20:04

Is it possible to remove the contents of the array based on the index? If I have 2 arrays like these:

Array1 that contains 15 values and I want to get the last 10 va

4条回答
  •  情歌与酒
    2020-12-29 20:23

    See splice()

    The splice() method changes the content of an array by removing existing elements and/or adding new elements.

    It won't create a new array, if you want to create new array use slice.

提交回复
热议问题