how to check is array or not in javascript code example
Example 1: if object is array javascript
Array.isArray(object);
Example 2: js check if is array
if(Array.isArray(colors)){
//colors is an array
}
Array.isArray(object);
if(Array.isArray(colors)){
//colors is an array
}