Answers for "how to check array data type in javascript"

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
0

js is of type array

Array.isArray([1, 2, 3]);  // true
Array.isArray({foo: 123}); // false
Array.isArray('foobar');   // false
Array.isArray(undefined);  // false
Posted by: Guest on January-15-2021

Code answers related to "how to check array data type in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language