A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.w3schools.com/jsref/jsref_includes_array.asp below:

Website Navigation


JavaScript Array includes() Method

JavaScript Array includes() Examples

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Mango");

Try it Yourself »

Start the search at position 3:

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Banana", 3);

Try it Yourself » Description

The includes() method returns true if an array contains a specified value.

The includes() method returns false if the value is not found.

The includes() method is case sensitive.

Array Find Methods: Method Finds includes() Returns true if an array contains a specified value indexOf() The index of the first element with a specified value lastIndexOf() The index of the last element with a specified value find() The value of the first element that passes a test findIndex() The index of the first element that passes a test findLast() The value of the last element that passes a test findLastIndex() The index of the last element that passes a test Syntax

array.includes(element, start)

Parameters Parameter Description element Required.
The value to search for. start Optional.
Start position. Default is 0. Return Value Type Description A boolean true if the value is found, otherwise false. Browser Support

includes() is a JavaScript 2016.

ES 2016 is supported in all modern browsers:

Chrome Edge Firefox Safari Opera Yes Yes Yes Yes Yes

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4