Find a value in an array of objects in Javascript - Stack Overflow

PHOTO EMBED

Fri Mar 12 2021 17:12:33 GMT+0000 (Coordinated Universal Time)

Saved by @brunomgmateus #javascript

let arr = [
    { name:"string 1", value:"this", other: "that" },
    { name:"string 2", value:"this", other: "that" }
];

let obj = arr.find(o => o.name === 'string 1');

console.log(obj);
content_copyCOPY

https://stackoverflow.com/questions/12462318/find-a-value-in-an-array-of-objects-in-javascript