robkar97
02-16-2008, 11:18 AM
I can't get simple array handling to function. Consider an array "myArray" that holds name/value pairs like so
var myArray = new Array();
myArray['first'] = 'this is a string';
myArray['the_second'] = 'this is another string';
myArray['any_string'] = 'hello world';
Now, myArray.length returns 0!
With
for (i in myArray) alert(i + ' =' + myArray[i]) I still get all three elements...
Also, myArray.spliice('the_second', 1) doesn't work - the array is left untouched.
:eek:
Robert
var myArray = new Array();
myArray['first'] = 'this is a string';
myArray['the_second'] = 'this is another string';
myArray['any_string'] = 'hello world';
Now, myArray.length returns 0!
With
for (i in myArray) alert(i + ' =' + myArray[i]) I still get all three elements...
Also, myArray.spliice('the_second', 1) doesn't work - the array is left untouched.
:eek:
Robert