Standard built-ins
Array.prototype.some()
Returns true at the first truthy predicate result among present indices. Skips ordinary holes; empty input returns false. Initial length bounds the search.
Formal Syntax & Structure
javascript syntaxjavascript
array.some(predicate, thisArg?)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| callback | function | Tests whether a value is a witness. |
| thisArg | any | Optional this value for ordinary callback functions. |
Return Value
boolean
True if at least one present element passes.
Working Example
Example Snippetjavascript
console.log([1,2,8].some(x=>x>5), [].some(x=>true));