1const array1 = [5, 12, 8, 130, 44];
2
3const found = array1.find(element => element > 10);
4
5console.log(found);
6// expected output: 12
7
1const inventory = [
2 {name: 'apples', quantity: 2},
3 {name: 'bananas', quantity: 0},
4 {name: 'cherries', quantity: 5}
5];
6
7function isCherries(fruit) {
8 return fruit.name === 'cherries' && fruit.name === 'bananas';
9}
10
11console.log(inventory.find(isCherries));
12// { name: 'cherries', quantity: 5 }