Javascript: Check if a variable is an Array
This article shows how you can check if a Javascript variable is of an Array type. There are different ways to check if a variable is an Array in Javascript. 1) First way // define an array var myArray = [11, 'John']; console.log(Object.prototype.toString.call(myArray)); // [object Array] // check if the variable is an array if … Read more