kwhubby
11-08-2002, 12:43 AM
how do you get the amount of non null variables an array.
In my example, I use x.length , but that gives the length of the entire array, how do I get it to tell me how many have been filled
var x = new Array(10)
x[0] = "blah blah blah''
x[1] = "ha ha ha"
x[2] = "I dont care"
alert(x.length) although this gives me what I dont want which is 10
I want it to tell me 3
:confused:
In my example, I use x.length , but that gives the length of the entire array, how do I get it to tell me how many have been filled
var x = new Array(10)
x[0] = "blah blah blah''
x[1] = "ha ha ha"
x[2] = "I dont care"
alert(x.length) although this gives me what I dont want which is 10
I want it to tell me 3
:confused: