Answers for "js how to check if array contain a element"

15

check if array does not contain value javascript

var fruits = ["Banana", "Orange", "Apple", "Mango"];

var n = fruits.includes("Mango"); // true

var n = fruits.includes("Django"); // false
Posted by: Guest on January-09-2021
1

js test if array

if(Array.isArray(myVarToTest)) {
	// myVatToTest is an array
} else {
	// myVarToTest is not an array
}
Posted by: Guest on September-02-2020

Code answers related to "js how to check if array contain a element"

Code answers related to "Javascript"

Browse Popular Code Answers by Language