array object remove

Hey, I'd like some help
I've been trying things for the past 30 mins and I jsut can't figure it out!

I've completely made the add, create, delete functions
they all work as they are supposed to

UNTIL I remove the first object, then it all goes to shit and no longer functions and I just can't figure out why tf this is happening
Whenever I look at the console.log(articles) in the console while messing around it ALWAYS returns the correct amount of objects in the array
UNTIL I even dare remove the first object, then it just breaks apart and the first object that's supposedly removed persists within the array

Yet every other element gets removed as intended, I don't get why this very first object is messing it up
I can edit its data as much as I want, no issues
but when I delete it, it just messes everything up

and the deletion is just a compare(a,b, index)
if(a==b)articles.splice(index,index)

Can someone please save my soul
If you want to fiddle around, here's the link
https://brights-store-app-prototype.netlify.app
(for those who don't speak dutch and prefer fiddling around to figure out whats making this happen; "opslaan" means save, clicking this will commit the changes
"annuleer" means cancel)
Was this page helpful?