What is the best way to remove an object from an array based on an attribute?
things = [{id:'23', color: 'blue'},{id:'54', color:'red'},{id:'132', color:'green'}]
I know the id I need to remove is '54'. What is the best process remove that object from the array? Result should be things = [{id:'23', color: 'blue'},{id:'132', color:'green'}]
I can run a loop and look at the id and then remove it if it matches but I was looking for a better way.
Thanks!
Use the filter function :