Got some instruction about how to check if a variable is Array in JavaScript from this book.
Here I just copy and record sth to make me more sensitive for how to check Array in JavaScript.
In the environment which support ES5, just use Array.isArrary(). For example:
COPY
Array.isArray([]); // true |
In somewhere that no ES5 support, just do this:
COPY
if (typeof Array.isArray === undefined) { |