DestinyHunter / DestinyHunter.github.io

Blog
https://DestinyHunter.cn
1 stars 0 forks source link

删除数组某一项 #11

Open DestinyHunter opened 6 years ago

DestinyHunter commented 6 years ago
  let index = arr.findIndex( (v,i,arr) => v.id === id)
  if (index !== -1) {
     arr.splice(index, 1)
  }