coderef

Iterator includes()Limited availability

The includes() method of an Iterator object returns true when an item yielded by the iterator is the same as a given value. It's similar to the includes() method of arrays.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–153Not supported
154+Supportedsince Sep 22, 2026
Current: 155
Edge
12–153Not supported
154+Supportedsince Sep 24, 2026
Current: 154
Firefox
1–153Not supported
154+Supportedsince Aug 18, 2026
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–153Not supported
154+Supportedsince Sep 22, 2026
Current: 155
Firefox Android
4–153Not supported
154+Supportedsince Aug 18, 2026
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: includes.

Feature detection

JS · check before using
if ("includes" in Iterator || ("prototype" in Iterator && "includes" in Iterator.prototype)) {
  // Iterator.includes is available
}