# Length of an array with string index

**URL:** https://forum.kirupa.com/t/length-of-an-array-with-string-index/267932
**Category:** flash
**Created:** [August 7, 2008, 12:44pm UTC](https://forum.kirupa.com/t/length-of-an-array-with-string-index/267932 "2008-08-07T12:44:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ayman](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayman](https://forum.kirupa.com/u/Ayman)
#### Post date: [August 7, 2008, 12:44pm UTC](https://forum.kirupa.com/t/length-of-an-array-with-string-index/267932/1 "2008-08-07T12:44:09Z")

</div>

You can find the length of an array through the property length (e.g. arrayInstance.length)

But I realize that I cannot use this property if I specify the array index through strings  
for example:

```auto
 
var arrayInstance = new Array();
arrayInstance["cat"] = "Garfield";
arrayInstance["dog"] = Jazzy Dog";
arrayInstance["mouse"] = "Mickey Mouse";
trace(arrayInstance.length) //returns 0 !!

```
