how to remove elements of array?

前端 未结 4 1409
情话喂你
情话喂你 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:22

    Use the function array.splice(index, count) to remove count elements at index. To remove elements from the end, use array1.splice(array1.length - 10, 1);

提交回复
热议问题