Are you a Mootools user and you wish that you could use the Enumerable coolness from Prototype?

Bas Wenneker has ported the functions over, and has written up the experience.

I really like the Prototype Framework and the functionality that comes with it, but I like Mootools even more because it’s so damn small and lightweight. Sometimes the minimalistic framework is just too light. Recently I needed some of Prototypes’ Enumerable functions for an Array but the app was implemented using Mootools. So I decided to take a look at the Array.each functions provided by the two frameworks. They’re implemented in different ways but by changing the Mootools Array.each I was able to treat a Mootools Array like a Prototype Enumerable. In this article I’ll describe how to ‘hack’ the Enumerable functionality into Mootools. If you just want the code you should take a look at my EnumArray.js.

Source: Ajaxian
Original Article: http://ajaxian.com/archives/porting-prototype-enumerable-functions-to-mootools-array-objects

Leave a Reply

You must be logged in to post a comment.



Site Navigation