1let arr = [
2 { name:"string 1", value:"this", other: "that" },
3 { name:"string 2", value:"this", other: "that" }
4];
5
6let obj = arr.find(o => o.name === 'string 1');
7
8console.log(obj);
1// To find a specific object in an array of objects
2myObj = myArrayOfObjects.find(obj => obj.prop === 'something');
1//The find() method returns the value of the first element in the provided array that satisfies the provided testing function.
2const array1 = [5, 12, 8, 130, 44];
3
4const found = array1.find(element => element > 10);
5
6console.log(found);
7// expected output: 12
1const array1 = [5, 12, 8, 130, 44];
2
3const found = array1.find(element => element > 10);
4
5console.log(found);
6// expected output: 12