Sorry sudden send resume in this reply
Hello
I am having a difficult time trying to enumerate a hash to determine if a
give key is in the hash and if so delete it and its value.
If I could approach it index it would be
function remove(valueToTest, hashToBeTested){
for(i=0;i<hashToBeTested.length;i++){
if(valueToTest==hashToBeTested[i]) hashToBeTested.unset(valueToTest);
}
Would I do it like
hashToBeTested.each(function(valueToTest){
if(valueToTest==this)hashToBeTested.unset(valueToTest);
},hashToBeTested);
return hashToBeTested;
which I am sure is wrong syntactically if not semantically. Can someone
guide the proper way and more deeply the use of this?
On Thu, Apr 8, 2010 at 3:06 PM, chrysanthe m <[email protected]> wrote:
>
>
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.