• Skip to main content
  • Skip to search
  • Skip to select language
HTML

Structure of content on the web

  • Web APIs

    Interfaces for building web applications

  • Learn
    • CSS

      Learn to style content using CSS

    • Overview

      A customized MDN experience

    • FAQ

      Frequently asked questions about MDN Plus

  • HTTP Observatory

    Scan a website for free

  • JavaScript
  • [Symbol.iterator]()
      • Deutsch
      • 日本語
      • 中文 (简体)

    In this article

    • Syntax
    • Examples
    • Specifications
    • Browser compatibility
    • See also
    1. from()
  • Instance methods
    1. find()
    2. reduce()
    3. [Symbol.iterator]()
  • Inheritance
  • call()
  • displayName Non-standard
  • arguments Non-standard Deprecated
  • caller Non-standard Deprecated
  • Instance methods
    1. __defineGetter__() Deprecated
    2. __defineSetter__() Deprecated
    3. __lookupGetter__() Deprecated
    4. __lookupSetter__() Deprecated
    5. toLocaleString()
    6. __proto__ Deprecated
    7. iterable protocol and allows built-in iterators to be consumed by most syntaxes expecting iterables, such as the this, which is the iterator object itself.

  • Syntax

    js
    iterator[Symbol.iterator]()
    

    Parameters

    None.

    Return value

    The value of iterable, and iterating syntaxes like the for...of loop automatically call this method to obtain the iterator to loop over.

    js
    const arrIterator = [1, 2, 3].values();
    for (const value of arrIterator) {
      console.log(value);
    }
    / Logs: 1, 2, 3
    

    Specifications

    Specification
    ECMAScript® 2026 Language Specification
    # sec-%iteratorprototype%-%symbol.iterator%

    Browser compatibility

    See also

    • Iterator
    • Symbol.iterator
    • Iteration protocols

    Help improve MDN

    for...of loop operates on a sequence of values sourced from an iterable object, such as arrays, array-like objects, DOM collections, iterators, generators, and user-defined iterables. All built-in iterators inherit from the Iterator class.","name":"Iterators and the for...of loop"}},"browserCompat":["javascript.builtins.Iterator.@@iterator"],"pageType":"javascript-instance-method"}}

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant