Find and remove objects in an array based on a key value in JavaScript

Here is a solution if you are not using jQuery:

myArray = myArray.filter(function( obj ) {
  return obj.id !== id;
});

Leave a Comment