How to check value is in array or not (inArray) ?


➤ Javascript includes() function used to check element is in array or not.

Suppose you want to check following user is avilable in userlist so we can easily find using includes() JavaScript function.

The includes() method determines whether an array contains a specified element.

This method returns true if the array contains the element, and false if not.

Note: The includes() method is case sensitive.

➤ Example - 1 : Simple Example Of includes() function.

Comments