I have a multidimensional array, like this:
[
[
{ name: "jeff", job: "cleaner" },
{ name: "kate", job: "cashier" }
],
[
{ name: "alice", job: "engineer" },
{ name: "sean", job: "writer" },
{ name: "ruby", job: "police officer" }
],
[
{ name: "sarah", job: "writer" },
{ name: "john", job: "cleaner" }
]
]
I'm looking for a fast and concise way to find an object within this structure where one of the properties matches a certain value and then remove that object entirely.
For example, say I want to find all objects where the property of job
is writer
and remove those objects from the structure.
Please bare in mind that I would like keep the current structure of this array completely intact, with just the relevant objects removed.