Skip to content

Reference for stage 2.7 iterator-includes#44226

Merged
Josh-Cena merged 2 commits into
mdn:mainfrom
Josh-Cena:iterator-includs
May 29, 2026
Merged

Reference for stage 2.7 iterator-includes#44226
Josh-Cena merged 2 commits into
mdn:mainfrom
Josh-Cena:iterator-includs

Conversation

@Josh-Cena
Copy link
Copy Markdown
Member

@Josh-Cena Josh-Cena requested a review from a team as a code owner May 22, 2026 17:41
@Josh-Cena Josh-Cena requested review from wbamberg and removed request for a team May 22, 2026 17:41
@github-actions github-actions Bot added Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed labels May 22, 2026

## See also

- [es-shims polyfill of `Iterator.prototype.includes`](https://www.npmjs.com/package/es-iterator-helpers)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@zloirock I did not find core-js for this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Josh-Cena now it's in v4 branch, I'll backport it in some days.

Comment thread files/en-us/web/javascript/reference/global_objects/array/includes/index.md Outdated
Comment thread files/en-us/web/javascript/reference/global_objects/iterator/includes/index.md Outdated
Comment thread files/en-us/web/javascript/reference/global_objects/iterator/includes/index.md Outdated
Comment thread files/en-us/web/javascript/reference/global_objects/iterator/index.md Outdated
---

The **`includes()`** method of {{jsxref("Iterator")}} instances is similar to {{jsxref("Array.prototype.includes()")}}: it returns `true` if it finds an element that is strictly equal to the given value. Otherwise, if the iterator is exhausted without finding such an element, it returns `false`.

Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee May 26, 2026

Choose a reason for hiding this comment

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

FMI, we're not doing interactive examples in JS any more?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We are, I'm just lazy and we don't have these for other Iterator pages 🤷‍♂️

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Your call. I don't think "lazy" is a term that can be applied to you.

Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Thanks very much @Josh-Cena - the fixes work for me.

@hamishwillee
Copy link
Copy Markdown
Collaborator

@Josh-Cena There is a failing check-redirects. I have not checked this - approved but not merged.

@Josh-Cena Josh-Cena merged commit 76972cd into mdn:main May 29, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants