#My remove button isnt working

3 messages · Page 1 of 1 (latest)

idle solar
dreamy delta
#

myArr = [0, 1, 2, 3, 4, 5, 6]
myArr[4] === 4
myArr.splice(3, 1)
[0, 1, 2, 4, 5, 6]
myArr[4] === 5
First you need to find out the index of the element in the array foodOrderedArray, which has an object with id === menuId and only then remove this element

idle solar
#

ok thank you Iryna...this helped to figure out what was wrong...i was using the id instead of the index