Instead of plain delete use splice

使用splice来删除

splice-delete.js

Array = ["a", "b", "c", "d"] 
const result = Array.splice(0, 2) ["a", "b"]

console.log('Array:',Array)

版权声明:著作权归作者所有。

thumb_up 1 | star_outline 0 | textsms 0