Of course you are right, and this case could easily be done by
something like

var removeElements = function () {
  return map(removeElement, flattenArguments(arguments));
};

but there are a lot of convenience and higher-level functions for
things to be done within some lines of code, so why not add this one,
too?

it depends on the philosophy, as you mentioned...

regards, Frank


On 11 Feb., 20:02, "Arnar Birgisson" <[EMAIL PROTECTED]> wrote:
> Mochikit seems to be getting a lot of requests like these (may of them
> from myself). As Bob has previously pointed out, making functions do
> different things is bad so in this case a new function would be
> better, buuut...
>
> I think there is no need in this case since one can always do this:
>
> map(removeElement, elements);
>
> Maybe someone needs to come up with the Zen of Mochikit. :o)
>
> Arnar
>
> On 2/11/07, Aaron Faanes <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > should removeElement have the ability to remove multiple elements?
>
> >     /** @id MochiKit.DOM.removeElement */
> >     removeElement: function (elem) {
> >         if(elem instanceof Array) {
> >             for(var i=0;i<elem.length; i++) {
> >                 MochiKit.DOM.removeElement(elem[i]);
> >             }
> >             return;
> >         }
> >         var e = MochiKit.DOM.getElement(elem);
> >         e.parentNode.removeChild(e);
> >         return e;
> >     },
>
> > or, alternatively:
>
> >     /** @id MochiKit.DOM.removeElement */
> >     removeElement: function (elem) {
> >         if(arguments.length > 1) {
> >             for(var i=0;i<arguments.length; i++) {
> >                 MochiKit.DOM.removeElement(arguments[i]);
> >             }
> >             return;
> >         }
> >         var e = MochiKit.DOM.getElement(elem);
> >         e.parentNode.removeChild(e);
> >         return e;
> >     },- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to