Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
HalidOdat opened this issue Oct 2, 2020 · 0 comments · Fixed by #704
Closed

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

HalidOdat opened this issue Oct 2, 2020 · 0 comments · Fixed by #704
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com

Comments

@HalidOdat
Copy link
Member

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

@HalidOdat HalidOdat added enhancement New feature or request Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com builtins PRs and Issues related to builtins/intrinsics labels Oct 2, 2020
@HalidOdat HalidOdat linked a pull request Oct 2, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant