JavaScript Array includes()
Example
Check if an array includes "Mango":
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Mango") // Returns true
Try it Yourself »
Definition and Usage
The includes() method returns true if an array contains a specified
element, otherwise false.
includes() is case sensitive.
Browser Support
The numbers in the table specify the first browser version that fully supports the method.
| Chrome 47 | Edge 14 | Firefox 43 | Safari 9 | Opera 34 |
| Des 2015 | Des 2015 | Des 2015 | Sep 2015 | Des 2015 |
includes() is not supported in Edge 13 (and earlier versions).
Syntax
array.includes(element, start)
Parameter Values
| Parameter | Description |
|---|---|
| element | Required. The element to search for |
| start | Optional. Default 0. At which position in the array to start the search |
Technical Details
| Return Value: | A Boolean |
|---|---|
| JavaScript Version: | ECMAScript 7 |
More Examples
Check if an array includes "Banana", starting the search at position 3:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Banana", 3); // Returns false
Try it Yourself »

