How to remove elements from an array?

Tell me how to remove elements from the array:
Pressed to delete the last item in the list: GUAVA 1 kg. Here is a screenshot from the debugger:
3fd888f7f21a45e0a7d17bc4472e3747.png

The function returned the array by removing the position of 1 kg PITAHAYA and not GUAVA 1 kg.
12c96c6309f94d1dbb097f1a9a49bc71.png

What is the error?
July 9th 19 at 13:37
1 answer
July 9th 19 at 13:39
Solution
Line 464, You have:
return i.name = name
Should be:
return i.name == name (double-equals)

Find more questions by tags ArraysJavaScriptjQueryOOP