JSFiddle - React, Tailwind, and code Playground
HTML
<h1>
Find an object in and array
</h1>
<div id="result">
gaga
</div>
JavaScript
const inventory = [
{name: 'apples', quantity: 2},
{name: 'bananas', quantity: 0},
{name: 'cherries', quantity: 5}
];
const result = inventory.find( fruit => fruit.name === 'cherries' );
document.getElementById("result").innerText = JSON.stringify(result);