MonkeyBoy
12-08-2003, 09:03 AM
Hi
I did a search of this forum in an attempt to find an answer to my question, but didn't find what I was looking for.
My situation is that I want users to add to an array, then if they choose to, clear the contents of that array and then start again.
e.g.
user adds three number to array: 1345, 17347, 3535
I can play with this array as usual.
But when I do
arrList = null;
Then alert(arrList);
I get "null".
But when the user (me) re-adds a value (67468), I get
undefined, undefined, undefined, 67468.
I also tried looping through the array, replacing the values with "", but I want to use the .length property of the array.
So the basic question, is how do I reset an array?
Help without sarcasm would be appreciated.
I did a search of this forum in an attempt to find an answer to my question, but didn't find what I was looking for.
My situation is that I want users to add to an array, then if they choose to, clear the contents of that array and then start again.
e.g.
user adds three number to array: 1345, 17347, 3535
I can play with this array as usual.
But when I do
arrList = null;
Then alert(arrList);
I get "null".
But when the user (me) re-adds a value (67468), I get
undefined, undefined, undefined, 67468.
I also tried looping through the array, replacing the values with "", but I want to use the .length property of the array.
So the basic question, is how do I reset an array?
Help without sarcasm would be appreciated.