• support@answerspoint.com

Length of a JavaScript object (that is, associative array)

1632

If I have a JavaScript associative array, say:

var myArray = new Object();
myArray["firstname"] = "Gareth";
myArray["lastname"] = "Simpson";
myArray["age"] = 21;

Is there a built-in or accepted best practice way to get the length of this array?

JavaScript does not have associative arrays -- it only has objects, which can be used as a notion of associative arrays.**

0Answer


Your Answer

    Facebook Share        
       
  • asked 8 years ago
  • viewed 1632 times
  • active 8 years ago

Best Rated Questions