I need to remove an item from a string indexed array.
Take a look at this sample code:
var arr = new Array();
arr[0] = "Zero";
arr[1] = "One";
arr[2] = "Two";
arr.splice(1, 1);
for (var index in arr)
document.writeln(arr[index] + " ");
//The output will be: Zero Two
var arr = new Array();
arr["Zero"] = "Zero";
arr["One"] = "One";
arr["Two"] = "Two";
arr.splice("One", 1); // This won't work
arr.splice(1, 1); // Nor will this
for (var index in arr)
document.writeln(arr[index] + " ");
//The result will be: Zero One Two
How can I remove "One" from the second example just like in the first example?