Prefer using Array#some
over Array#find
when ensuring at least one element in the array passes a given check.
if (array.find(element => element === '🦄')) {
// …
}
const foo = array.find(element => element === '🦄') ? bar : baz;
if (array.some(element => element === '🦄')) {
// …
}
const foo = array.find(element => element === '🦄') || bar;