---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Symbol.iterator

The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of).

## Value

The well-known symbol `Symbol.iterator`.

## Description

Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated.

Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are:

- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx)
- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx)
- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx)
- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx)

See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information.
