- The find() method returns the value of the first element in the provided array that satisfies the provided testing function.
const array1 = [{id:'1',name:'test'}, {id:'2',name:'test2'}];
const found = array1.find(element => element.id === '1');
console.log(found);
OutPut:
Object { id: "1", name: "test" }
Top comments (0)