problem with array length
|
| View previous topic :: View next topic |
| Author |
Message |
Gladis
Joined: 24 May 2006 Posts: 108
|
I noticed that some of my arrays have a wierd length, it is bigger than whats in there. i have 2 elements in one right now, but length is 8
Why is that? |
| |
|
|
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| Try concatenating the values and alerting them, maybe that will give you an idea as to where its happening. |
| |
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
if i alert arr.length I get 7 but there is only one elemnt in the array
I use javascript debugger |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| What if you alert( arr[3] ); ? |
| |
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
I found my problem
I had a loop to create this multidemensional array. But i would not start with the [0] value when i created a new array. it was in a loop. so an array would just have vallue arr[8] and thats it. the length would be 9 |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| nice.;) |
| |
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
I would have though length would be dynamic
But its not
Or a function, but its just a variable |
| |
|
|
|
|