Answers for "Search array of objects for existing value"

0

Search array of objects for existing value

const arrayOfObject = [{ id: 1, name: 'john' }, {id: 2, name: 'max'}];

const checkUsername = obj => obj.name === 'max';

console.log(arrayOfObject.some(checkUsername))
Posted by: Guest on October-11-2021

Code answers related to "Search array of objects for existing value"

Browse Popular Code Answers by Language