Answers for "check it is array or not js"

13

javascript check if is array

var colors=["red","green","blue"];

if(Array.isArray(colors)){
    //colors is an array
}
Posted by: Guest on July-22-2019
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 it is array or not js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language