Modifying the Object.prototype is Verboten (cretits cpojer), I think
there are enough resources on the interwebs that can explain that.

That's why Hash existed, to make a elegant way of modifying objects.
However since ES5 uses a lot of those Object.* functions, that will be
the new standard, so MooTools uses a similar approach, since MooTools
wants to make JavaScript itself better. Tbh I don't know if this is
the actual reason, but it is a good one imo.

If you've got a really big project, and still want to write elegant
code, you might consider Hash, that's why we didn't remove it at all,
but moved it to MooTools More. With a bit of luck you'll win some
bytes back because of the slightly shorter syntax ;)


On Nov 4, 7:34 pm, Sean McArthur <[email protected]> wrote:
> Hash is definitely more elegant, and that's why it exists. However, some
> people might not care or need to use those methods enough to make the extra
> file size worth it.
>
>
>
> On Thu, Nov 4, 2010 at 9:43 AM, Ronny <[email protected]> wrote:
> > Using a hash looks more elegant for me, but I'd love to learn what are
> > the benefits of each(no pun intended) approach.
> > Simplified examples:http://jsfiddle.net/Ronny/zmfK8/
>
> >  - Ronny
>
> > On Nov 4, 12:13 am, Sean McArthur <[email protected]> wrote:
> > > Object.each is a generic method, not an instance method. MooTools doesn't
> > > modify the Object prototype, so you cant do ({ a: 1 }).each().
>
> > > The correct way to do is shown as an example in the docs:
>
> > > Object.each(myObj, function(val, key) {
>
> > > });
>
> > > On Wed, Nov 3, 2010 at 3:10 PM, André Fiedler
> > > <[email protected]>wrote:> Don´t know where´s the problem.
> > Could someone plz help me?
>
> > > >http://jsfiddle.net/SunboX/MNmGg/
>
> > > > greetings Sunny

Reply via email to