How do you check if a variable is an array in JavaScript ?
- by Andy McCluggage
I would like to check whether a variable is either an array or a single value in JavaScript.
I have found a possible solution...
if (variable.constructor == Array)...
Is this the best way this can be done?