I have an array in javascript that looks like this:
arr = ["md51234","md55234"]
I'm trying to remove an item from this by doing:
delete arr["md51234"]
But this doesn't seem to work. Is there another way to remove this?
@dystroy provided the answer, I added indexOf to the array prototype for non-compliant browsers:
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
}