redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Thursday 18 October 2018 20:42

Ask your IT question here

problem with array length



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum
View previous topic :: View next topic  
Author Message
Gladis
Enthusiastic Coder


Joined: 24 May 2006
Posts: 107
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?

Reply with quote
 
Jackil
Enthusiastic Coder


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.
Reply with quote
 
Gladis
Enthusiastic Coder


Joined: 24 May 2006
Posts: 107
if i alert arr.length I get 7 but there is only one elemnt in the array
I use javascript debugger

Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
What if you alert( arr[3] ); ?
Reply with quote
 
Gladis
Enthusiastic Coder


Joined: 24 May 2006
Posts: 107
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

Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
nice.;)
Reply with quote
 
Gladis
Enthusiastic Coder


Joined: 24 May 2006
Posts: 107
I would have though length would be dynamic
But its not
Or a function, but its just a variable

Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo