programming-examples/js/Array/Write a JavaScript function to check whether an `input` is an array or not..js

7 lines
213 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
is_array = function(input) {
if (toString.call(input) === "[object Array]")
return true;
return false;
};
console.log(is_array('w3resource'));
console.log(is_array([1, 2, 4, 0]));