Skip to content

Implement Array Iterator ( Array.prototype[@@Symbol.iterator] ) #762

Closed

Description

@HalidOdat

ECMASCript feature
Explain the ECMAScript feature that you'd like to see implemented.

Implementing the array iterator would involve setting the Array.prototype[@@Symbol.iterator]

var arr = ['a', 'b', 'c', 'd', 'e'];
var eArr = arr[Symbol.iterator]();
console.log(eArr.next().value); // a
console.log(eArr.next().value); // b
console.log(eArr.next().value); // c
console.log(eArr.next().value); // d
console.log(eArr.next().value); // e

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator

Activity

  1. added
    A-Enhancement
    Hacktoberfest
    C-Builtins
    on Oct 2, 2020
  2. linked a pull request that will close this issueImplementation of for...of loops #704on Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-EnhancementC-BuiltinsHacktoberfest

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions