How do I check if a variable is an array in JavaScript?
How do I check if a variable is an array in JavaScript? if (variable.constructor == Array) 2 25 There are several ways of checking if an variable is an array or not. The best solution is the one you have chosen. variable.constructor === Array This is the fastest method on Chrome, and most likely all … Read more