// Length of a JavaScript object (that is, associative array) Object.keys(myArray).length; // http://stackoverflow.com/questions/5223/length-of-a-javascript-object-that-is-associative-array