Here's something...but it might be super overkill http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/