javascript for loop return value

JavaScript
const target = myarray.find(item => item.name === 'xyz');

Source

Also in JavaScript: