seemed like a simple task but im finding it hard to achive. I have object containing child objects, and while looping over them i would like to delete an inner object in based on value of one of it's fields (this field exists in every inner object).
the loop goes like this:
for (let old_item of this.updated_items) {
if (old_item['content_id'] === item.content_id) {
this.updated_items.***DELETE***(old_item)
}
}
I marked location where is the missing logic.
How would i delete old_item from this.updated_items?
ES6 if possible..thx
this.updated_items? An array, aMap? Without that information it's impossible to answer the question. All you've shown is that it is iterable.typeof()'s ofthis.updated_itemsand its content...which are the items, equal toObject