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

Infinite iterators can be used with for...of if we eventually break out of the loop through some means #37096

Open
Hexstream opened this issue Dec 4, 2024 · 0 comments
Labels
Content:JS JavaScript docs

Comments

@Hexstream
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take

What specific section or headline is this issue about?

Using take() with a for...of loop

What information was incorrect, unhelpful, or incomplete?

Because fibonacci() is an infinite iterator, you can't use a for loop to iterate it directly.

You absolutely can, provided that you eventually break out of the loop through some means such as break, return, throw, etc.

What did you expect to see?

No incorrect statement.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@Hexstream Hexstream added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 4, 2024
@github-actions github-actions bot added the Content:JS JavaScript docs label Dec 4, 2024
@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

No branches or pull requests

2 participants