Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Checking Type of Array

Array.isArray(arr)
// Examples
Array.isArray([1, 2, 3]);  // true
Array.isArray('foobar');   // false for strings
Array.isArray({foo: 123}); // false for objects

var data = ['a', 'b', 'c']
var isArray = Array.isArray(data)
console.log(isArray)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Checking #Type #Array
ADD COMMENT
Topic
Name
5+3 =