Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Check propery of an objects array

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

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

console.log(arrayOfObject.some(checkUsername))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Check #propery #objects #array
ADD COMMENT
Topic
Name
3+5 =