web hosting and development forums
Web Design and Development Forums Archive


Index - JavaScript forum

problem with array length


Post reply

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?
Try concatenating the values and alerting them, maybe that will give you an idea as to where its happening.
if i alert arr.length I get 7 but there is only one elemnt in the array I use javascript debugger
What if you alert( arr[3] ); ?
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
nice.;)
I would have though length would be dynamic But its not Or a function, but its just a variable




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com