How to check if a Javascript variable is an array
Looking for the simplest way to check if a Javascript variable / object is an array? Here’s a simple way on how to check for an Array variable in javascript:
function isArray(variable) {
if (variable.constructor == Array)
return true;
else
return false;
}or better yet, just do this:
function isArray(variable) {
return (variable.constructor == Array);
}








Type checking





















![QRcode[tag-type-checking] QRcode:tag-type-checking](http://www.codestuff.com/wp-content/blogs.dir/7/qrcode-cache/tag-type-checking.jpg)