Is there a good functional style way of deleting elements in a JS array while looping?
I know filter can be used to create a new array:
var newArr = arr.filter((x) => x.foo > bar)
But is there a way to actually delete the elements from arr as you go?
BTW: I can't reassign, this is a data object on Vue component, so I need to update, not reassign.
BTW2: This is not a duplicate. I know how to do it with normal JS iteration. I am looking for a functional way, and the referenced answer doesn't contain that. Not a dupe.
arr = arr.filter((x) => x.foo > bar)??