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

Correction to Iterator.prototype.flatMap()'s callback return type #33475

Merged
merged 2 commits into from
May 19, 2024

Conversation

mb21
Copy link
Contributor

@mb21 mb21 commented May 7, 2024

Description

Correction to Iterator.prototype.flatMap()'s callback return type, which always needs to be an iterator. E.g this does not work (check in Chrome or using a polyfill):

[1, 2, 3].values().flatMap(num => num === 2 ? [2, 2] : 1).toArray()

Motivation

motivated by tc39/proposal-iterator-helpers#275 (comment)

@mb21 mb21 requested a review from a team as a code owner May 7, 2024 16:53
@mb21 mb21 requested review from Josh-Cena and removed request for a team May 7, 2024 16:53
@github-actions github-actions bot added Content:JS JavaScript docs size/xs 0-5 LoC changed labels May 7, 2024
Copy link
Contributor

github-actions bot commented May 7, 2024

Preview URLs

(comment last updated: 2024-05-19 13:32:53)

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Josh-Cena Josh-Cena merged commit b9c5849 into mdn:main May 19, 2024
8 checks passed
@mb21 mb21 deleted the patch-2 branch May 20, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/xs 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants