some()

noun

say it: “SUM” /sʌm/

A JavaScript array method that returns true if at least one item passes the test you give it, and false if none do. It stops at the first item that passes.

What does some() do in JavaScript?

some() — An Array method that reports whether at least one item passes a test.

const scores = [82, 91, 76];
const allPassed = scores.every(score => score >= 70);

In a sentence

  • “songLengths.some((seconds) => seconds > 300) told me at least one song runs over five minutes.”

Level: Journeyman · More JavaScript terms at this level

Updated