Use .some()
or .every()
check on one array repeatly can simplify to use one call.
if (
array.some(element => element.foo === 1)
|| array.some(element => element.bar === 2)
) {}
if (
array.every(element => element.foo === 1)
&& array.every(element => element.bar === 2)
) {}
if (
array.some(element => element.foo === 1 || element.bar === 2)
) {}
if (
array.every(element => element.foo === 1 && element.bar === 2)
) {}
Not sure about the name yet
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too