TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript TypedArray includes() Method

JavaScript TypedArray includes() Method with example, join() method, javascript typedarray methods, keys() method, indexOf() method, includes() method, forEach() method, entries(), every(), find(), filter(), copyWithin() method etc.

<< Back to JAVASCRIPT

JavaScript TypedArray includes() Method

The JavaScript Array includes() method is inbuilt function in JavaScript which is used to determine whether a particular element is present in the array or not. This method returns true if the element is present in the array otherwise false.

  • The includes() method is case sensitive.

Syntax:

array.includes(searchElement, start)

Parameters:

Search: The element to search for

Start: Default 0. At which position start to search.

Return value:

It returns a Boolean value, either True or False.

Browser Support:

Chrome 41
Edge 9
Firefox 40
Opera 28

Example 1

JavaScript TypedArray includes() Method

<script type="text/javascript">
// JavaScript to illustrate includes() method
  // Taking input as an array 
    var JavaTpoint= [12,24,56,78,2];
     a = JavaTpoint.includes(2)
  document.write(a);
// expected output: arr[Output:2]
</script> 
Test it Now

Output:

True

Example 2

JavaScript TypedArray includes() Method

<script type="text/javascript">
// JavaScript to illustrate includes() method
  // Taking input as an array 
    var JavaTpoint= [12,24,56,78];
     a = JavaTpoint.includes(2)
 
    document.write(a);
// expected output: arr[Output:false]
</script> 
Test it Now

Output:

False





Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf