coderef

Array includes()Baseline · Widely available

The includes() method of arrays and typed arrays returns whether a given value appears in the array.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 20, 2016. Widely available since Mar 20, 2019.

Browser support

DesktopChrome
1–46Not supported
47+Supportedsince Dec 1, 2015
Current: 155
Edge
12–13Not supported
14+Supportedsince Aug 2, 2016
Current: 154
Firefox
1–42Not supported
43+Supportedsince Dec 15, 2015
Current: 157
Safari
1–9.1Not supported
10+Supportedsince Sep 20, 2016
Current: 27
MobileChrome Android
18–46Not supported
47+Supportedsince Dec 2, 2015
Current: 155
Firefox Android
4–42Not supported
43+Supportedsince Dec 15, 2015
Current: 157
Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: includes.

Feature detection

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

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Array.includes471443947439
TypedArray.includes47144310474310