Answers for "delete all objects in array of objects with specific attribute"

0

delete all objects in array of objects with specific attribute

const arrayOfObjects = [{'objId' : 1, 'name' : 'objectA'}, {'objId': 2, 'name' : 'objectB'}];

// remove object with objId === 1 from the Array arrayOfObjects
const newArrayOfObjs = arrayOfObjects.filter(obj => obj.objId !== 1);
Posted by: Guest on July-30-2021

Code answers related to "delete all objects in array of objects with specific attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language