Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check value is array or not in javascript

// how to check value is array or not in javascript
const str = "foo";
const check = Array.isArray(str);
console.log(check);
// Result: false

const arr = [1,2,3,4];
const output = Array.isArray(arr);
console.log(output);
// Result: true
 
PREVIOUS NEXT
Tagged: #check #array #javascript
ADD COMMENT
Topic
Name
8+4 =