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

More explicitly differentiate between iterator helper methods/objects #36711

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Josh-Cena
Copy link
Member

Fix #36699. @hamishwillee has expressed the same concern before.

@Josh-Cena Josh-Cena requested review from a team as code owners November 9, 2024 22:59
@Josh-Cena Josh-Cena requested review from pepelsbey and wbamberg and removed request for a team November 9, 2024 22:59
@github-actions github-actions bot added Content:JS JavaScript docs Content:Firefox Content in the Mozilla/Firefox subtree size/s [PR only] 6-50 LoC changed labels Nov 9, 2024
Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

Looks good! Just a small syntax suggestion. Thank you :)

Among these methods, {{jsxref("Iterator/filter", "filter()")}}, {{jsxref("Iterator/flatMap", "flatMap()")}}, {{jsxref("Iterator/map", "map()")}}, {{jsxref("Iterator/drop", "drop()")}}, and {{jsxref("Iterator/take", "take()")}} return a new _Iterator Helper_ object. The iterator helper is also an `Iterator` instance, making the helper methods chainable. All iterator helper objects inherit from a common prototype object, which implements the iterator protocol:
### Iterator helper objects

> **Note:** _Iterator helper objects_ and _iterator helper methods_ are two different concepts. An Iterator helper object is detectable at runtime, while "iterator helper method" is just a name for a set of methods for comprehension. _Iterator helper_ may refer to either the object or the method, depending on the context.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> **Note:** _Iterator helper objects_ and _iterator helper methods_ are two different concepts. An Iterator helper object is detectable at runtime, while "iterator helper method" is just a name for a set of methods for comprehension. _Iterator helper_ may refer to either the object or the method, depending on the context.
> [!NOTE]
> _Iterator helper objects_ and _iterator helper methods_ are two different concepts. An Iterator helper object is detectable at runtime, while "iterator helper method" is just a name for a set of methods for comprehension. _Iterator helper_ may refer to either the object or the method, depending on the context.

Let’s use the latest note syntax.

Copy link
Member Author

@Josh-Cena Josh-Cena Nov 19, 2024

Choose a reason for hiding this comment

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

See the note in the section you linked:

Currently, due to a Prettier bug, the GFM alert syntax cannot be used if the first character of a note or warning is a formatting symbol, such as a backquote, asterisk, square bracket or curly bracket. In this case, use the old syntax > **Note:** instead. Writers are not required to rephrase the content to work around the formatter.

Also we have MarkdownLint that reports the old syntax where you can change it, so rest assured that you don't have to check it during review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguity of concept "iterator helper"
2 participants