JavaScript

just visit here

·

1 min read

you may not know or know

when using {{splice}} the first argument is an index of array, not element itself

your code should be

let i = list.map(item => item.id).indexOf(itemID) // find index of your object

list.splice(i, 1) // remove it from array