# The number of items inside an array

**URL:** <https://forum.kirupa.com/t/the-number-of-items-inside-an-array/323425>\
**Category:** flash\
**Created:** [June 30, 2011, 5:25am UTC](https://forum.kirupa.com/t/the-number-of-items-inside-an-array/323425 "2011-06-30T05:25:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@yani](https://forum.kirupa.com/u/yani)\
**Post date:** [June 30, 2011, 5:25am UTC](https://forum.kirupa.com/t/the-number-of-items-inside-an-array/323425/1 "2011-06-30T05:25:52Z")

</div>

Hi everyone,

I have an Array where in position 0, there are two items “name1” and “name2”, then in position 1, there is only 1 item “name3”, and position 2 there is only 1 item “name4”.

now when I trace like this:

trace(exampleArray[0].length)

the result is 2;

but when I trace like this:

trace(exampleArray[1].length)

the result is 5;

I understand that on the second trace its counting the length of the item so its the number of letters that its returning. I’m just wondering how can I get it to return 1, which is the number of items in that position which is what I’m interested in.

Any help would be greatly appreciated

Thanks
