Relative Content

Tag Archive for javascriptreactjsnode.jsexpressnext.js

I am unable to properly remove items from an array

I have a nextjs and expressjs web application and I initially thought that what I wanted to do would be easier but I have not been able to achieve what I want to do. The task is for me to remove selected items from an array.
The client side has items that I selected and stored in an array, this array of selected strings would be sent to the backend. I would need to remove those items from the array storing the items in backend.
However, I find out that if I select just one item, it deletes properly but if I select more than 2, it would delete the first two items and will not delete the others.
Here is the code: