tags:

views:

119

answers:

2

Possible Duplicate:
How to detect if a variable is an array

Hi,

Just wondering if people could please let me know how to check for this using javascript.

Thanks. Tony.

+2  A: 

(obj instanceof Array)

Knio
Just for reference, the above method does not work with array objects residing in iframes/frames.
Ionuț G. Stan
Doesn't work in alot of cases
mcjabberz
+5  A: 

The better way I saw is used in jQuery isArray method:

toString.call(obj) === "[object Array]"
Alex Pavlov