# Tracing the length of an associative array?

**URL:** <https://forum.kirupa.com/t/tracing-the-length-of-an-associative-array/206479>\
**Category:** Uncategorized\
**Created:** [November 8, 2006, 5:45pm UTC](https://forum.kirupa.com/t/tracing-the-length-of-an-associative-array/206479 "2006-11-08T17:45:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfoley](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jfoley](https://forum.kirupa.com/u/jfoley)\
**Post date:** [November 8, 2006, 5:45pm UTC](https://forum.kirupa.com/t/tracing-the-length-of-an-associative-array/206479/1 "2006-11-08T17:45:21Z")

</div>

This should be an easy one for you guys.  
I haven’t doen this in so long I forget how its done…

Ok, so I got an assocaitive object array like this:  
myArray = new Object();  
myArray[0] = {item:“item1”, price:"$1.99", active:0};  
myArray[1] = {item:“item2”, price:"$1.99", active:0};  
myArray[2] = {item:“item3”, price:"$1.99", active:0};

Now, how do I track the length of this object array.

I would have thought it was:  
trace(myArray.length);

But thats not the solution.  
Any ideas?

Thanks!
