Array.some() Does any item match
Last updated: 2026-09-09
Array.some() Does any item match
some reports whether at least one element passes the test, returning a boolean; it stops at the first match. Use every for 'all'.
| Category | Arrays |
|---|---|
| ES version | ES5 (2009) |
📝 Syntax
const anyMatch = array.some((element, index, array) => condition);
⚙️ Parameters
| callback | Test function; the first truthy result stops the search. |
|---|
Returns:A boolean.
Mutates the original:No (returns a new value)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
true
true
💡 Tip some stops at the first match — cheaper and clearer than filter(...).length > 0.
ℹ️ info some on an empty array is always false; every is always true — complementary by design.
🌐 Browser support
| Browser | |||||
|---|---|---|---|---|---|
| Array.some() | ✓ v1 | ✓ v12 | ✓ v1.5 | ✓ v3 | ✓ v10.5 |
| Supported by all modern browsers | |||||
🏷️ Related Array Methods
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
Qsome vs every?
Asome = at least one passes; every = all pass. Both short-circuit.
QCan some find objects?
AYes — users.some(u => u.id === 3) matches by property, unlike includes' reference check.
QMust the callback return?
AYes — undefined counts as false; a missing return makes some always false.