Standard built-ins

Symbol.iterator

Try the free JavaScript compiler

Key for the method that returns a synchronous iterator. A self-iterable iterator returns itself from this method.

Formal Syntax & Structure

javascript syntaxjavascript
Symbol.iterator

Return Value

symbol

The predefined protocol key.

Working Example

Example Snippetjavascript
const it=[1][Symbol.iterator]();console.log(it.next().value);
JavaScript Reference