Use splice remove the current position of the item in the list

var arr = [1,2,3,4]
//现在要删除3
arr.splice(arr.indexOf(3), 1)
=>
arr=>[1,2,4]

Guess you like

Origin blog.csdn.net/weixin_43565820/article/details/90519090