Answers for "check variable is array or not in javascript"

3

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
4

in javascript check is is an array or not

Array.isArray(yourItem)
Posted by: Guest on May-21-2020
0

check variable is array or not in javascript

// npm i is-js-array 
const { isJSArray } = require("is-js-array");
isJSArray([]); // true
isJSArray({}); // false
Posted by: Guest on August-31-2021

Code answers related to "check variable is array or not in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language