Language concepts

Iterator next() contract

Try the free JavaScript compiler

Advances an iterator and returns an iteration result object. Some iterators, notably generators, interpret a supplied value; ordinary array iterators ignore it.

Formal Syntax & Structure

javascript syntaxjavascript
iterator.next([value])

Parameters & Attributes

NameTypeDescription
valueanyOptional input, protocol dependent.

Return Value

object

Iteration result.

Working Example

Example Snippetjavascript
console.log(JSON.stringify([9].values().next()));
JavaScript Reference