The only solution I see is to create a new array by looping through the array
like this:
function removeAssociativeEntry (startArray, entryName) {
newarray=[];
for (var i in StartArray) {
if (entryNamei) {
newarray [i]=startArray[i];
}
}
return
: Wednesday, November 09, 2005 3:50 PM
Subject: [Flashcoders] removing a entry from an associative array?
The only solution I see is to create a new array by looping through the
array like this:
function removeAssociativeEntry (startArray, entryName) {
newarray=[];
for (var i
@chattyfig.figleaf.com
Sent: Wednesday, November 09, 2005 4:14 PM
Subject: Re: [Flashcoders] removing a entry from an associative array?
delete??
function removeAssociativeEntry (startArray, entryName) {
delete startArray[entryName];
}
regards,
Muzak
- Original Message - From: David Skoglund
[EMAIL
]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, November 09, 2005 4:14 PM
Subject: Re: [Flashcoders] removing a entry from an associative array?
delete??
function removeAssociativeEntry (startArray, entryName) {
delete startArray[entryName];
}
regards,
Muzak
well - if it's an associative array, then the name of the element is its
index, so that answers your second question. And if you set the element
to undefined, you will get the same result as the loop you are doing...
startArray[entryName] = undefined;
(also, perhaps your code works but I'm
5 matches
Mail list logo