javascript check if value is array or string 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
}