> I recently had the wish for extended functions on arrays, hashs and
> objects
> like Prototype provides with extending the Array() object. I often used
> features like without() and truncate(). I am really thinking of
> rewriting/porting a lot of stuff for jQuery and call it "jQuery Methods",
> but I have still thoughts going on about the right implementation.
>
> My myself, I personally don't really enjoy extending javascripts internal
> array object, because you can't use things like (for n in somearray){}
> anymore without a second check.
> One possibility would be to provide something like $M, and to stuff the
> jQuery way like this.
>
> var myArray = [1,2,5,3,4,5];
> var myArrayWithout5 = $M(myArray).without(5);
>
> Of course it's not as short as myArray.without(5).
>
> Tell my your opinions and ideas, I'm looking forward for it!
Don't use for-in loops on arrays!
If you stick to that rule, there is no reason why you couldn't just extend the
Array prototype. It will prevent a lot of trouble anyway.
--
Jörn Zaefferer
http://bassistance.de
--
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/