Answers for "how to check type of value in array javascript"

9

check if a variable is array in javascript

// inside if else check
if(Array.isArray(myVarToTest)) {
	// myVatToTest is an array
} else {
	// myVarToTest is not an array
}
Posted by: Guest on January-08-2021
10

javascript is int in array

[1, 2, 3].includes(2);     // true
[1, 2, 3].includes(4);     // false
[1, 2, 3].includes(1, 2);  // false (second parameter is the index position in this array at which to begin searching)
Posted by: Guest on June-27-2020

Code answers related to "how to check type of value in array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language