if type of array javascript code example
Example: 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
}
// inside if else check
if(Array.isArray(myVarToTest)) {
// myVatToTest is an array
} else {
// myVarToTest is not an array
}