I have an array of objects:
var items = [{ id: 1, text: "test1" }, { id: 2, text: "test2" }, { id: 3, text: "test3"}];
I have the following object:
var itemToRemove = { id: 2, text: "test2" };
I want to check by id if itemToRemove
exists in the items
array.
And remove it:
// pseudo code
items.remove(itemToRemove);
I went through javascript array methods but found nothing that will do the job. Thanks!