find: Return the first element which satisfies the condition

PHOTO EMBED

Fri Sep 16 2022 16:36:05 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

const ages = [24, 22, 25, 32, 35, 18]
const age = ages.find((age) => age < 20)

console.log(age)
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/09_Day_Higher_order_functions/09_day_higher_order_functions.md