Standard built-ins

Iterator.prototype.some()

Try the free JavaScript compiler

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

NameTypeDescription
predicatefunctionTest 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)));
JavaScript Reference