Answers for "i have an array of objects. how do i find if a value matches the value in one of my arrays"

11

find a single element in array of objects javascript

myArray.find(x => x.id === '45').foo;
Posted by: Guest on May-25-2020
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 "i have an array of objects. how do i find if a value matches the value in one of my arrays"

Code answers related to "Javascript"

Browse Popular Code Answers by Language