forum

Home / DeveloperSection / Forums / Length of Javascript Object (ie. Associative Array)

Length of Javascript Object (ie. Associative Array)

Anonymous User 2774 14-Feb-2013

Hi!

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?

EDIT: JavaScript does not have associative arrays -- it only has objects.

Please help me!

Thanks in advance!


Updated on 16-Feb-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By