# Array\[Array.length\] doesn't seem to work properly?

**URL:** https://forum.kirupa.com/t/array-array-length-doesnt-seem-to-work-properly/331355
**Category:** flash
**Created:** [July 13, 2013, 3:44pm UTC](https://forum.kirupa.com/t/array-array-length-doesnt-seem-to-work-properly/331355 "2013-07-13T15:44:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)
#### Post date: [July 13, 2013, 3:44pm UTC](https://forum.kirupa.com/t/array-array-length-doesnt-seem-to-work-properly/331355/1 "2013-07-13T15:44:21Z")

</div>

Hey everyone. So I’m just doing a few things with arrays at the moment, and I am using this code to add an element from **allNodes** to **checkNodes** :

```auto
checkNodes[checkNodes.length] = allNodes*;

```

I run a trace on the array before and after I run this code, and the element is added just fine!

But if I add a trace directly after it like this:

```auto
checkNodes[checkNodes.length] = allNodes*;
trace(checkNodes[checkNodes.length]);

```

I am returned an \*undefined. \*​

BUT, if I change it to trace a specific element like this:

```auto
checkNodes[checkNodes.length] = allNodes*;
trace(checkNodes[0]);

```

I am returned the correct value! Why exactly would that be?

Thanks in advance for your help!
