includes()
JavaScript Array includes() method
Last Updated : 17 Mar 2025
The JavaScript array includes() method checks whether the given array contains the specified element. It returns true if an array contains the element, otherwise false.
Syntax
The includes() method is represented by the following syntax:
Parameter
element - The value to be searched.
start - It is optional. It represents the index from where the method starts search.
Return
A Boolean value.
JavaScript Array includes() method example
Here, we will understand includes() method through various examples.
Example 1
Let's see a simple example to determine whether the given array contains the specified element.
Test it NowOutput:
Example 2
In this example, we will provide the index from where the search starts.
Test it NowOutput:
Example 3
Let's see one more example to determine whether the includes() method is case-sensitive.
Test it NowOutput: