isArray JavaScript

Simple JavaScript function that returns true if is an array or false if it’s not ;)

function isArray(obj) {
     if (obj.constructor.toString().indexOf("Array") == -1)
	      return false;
     else return true;
}
Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • BarraPunto
  • Bitacoras.com
  • FriendFeed
  • Meneame
  • Netvibes
  • Reddit
  • StumbleUpon
  • Tumblr
  • Wikio
  • RSS
  • email
  • PDF
  • Print

Related posts:

  1. Delete element from array in PHP
  2. JavaScript to return dimensions
  3. Change the CSS of your site with JavaScript
  4. Check file extension in JavaScript
  5. Allow only numbers or letters in HTML inputs

Leave a Reply

Follow me