Standard built-ins
Iterator.prototype.some()
Consumes until a predicate is truthy, closing the source on early success; false for an empty sequence.
Formal Syntax & Structure
javascript syntaxjavascript
iterator.some(predicate)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| predicate | function | Test callback. |
Return Value
boolean
Result of the operation.
Working Example
Example Snippetjavascript
console.log(JSON.stringify(Iterator.from([1,2,3]).some(x=>x===2)));