Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.
The Symbol.iterator static data property represents the well-known symbol Symbol.iterator. The iterable protocol looks up this symbol for the method that returns the iterator for an object. In order for an object to be iterable, it must have a [Symbol.iterator] key.
The well-known symbol Symbol.iterator.
| Writable | no |
| Enumerable | no |
| Configurable | no |
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. Some built-in types with a [Symbol.iterator]() method are:
See also Iteration protocols for more information.
We can make our own iterables like this:
Or iterables can be defined directly inside a class or object using a computed property:
If an iterable's [Symbol.iterator]() method does not return an iterator object, then it is a non-well-formed iterable. Using it as such is likely to result in runtime exceptions or buggy behavior:
| ECMAScript® 2027 Language Specification # sec-symbol.iterator |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Oct 30, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.