Answers for "check is array in js"

PHP
9

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
2

how to check if something is array javascript

function isArray(value) {
    return Object.prototype.toString.call(value) === "[object Array]";
}
Posted by: Guest on May-06-2020
0

how to check if array

// Check if something is an Array 
// just like you do with "typeof"
Array.isArray([1, 2, 3]);	// true
Array.isArray('asdf');		// false
Posted by: Guest on October-14-2020
0

is array

$arr = 'This is not array only string';
 
if ( is_array($arr)) {    
    echo 'Available';
}
Posted by: Guest on September-25-2021

Browse Popular Code Answers by Language