I feel the need to have a little rant about MooTools and ES7 and the whole 'Array.contains' hoo-hah.
When MooTools came out in 2006, the most popular framework was Prototype. As the name suggests, it extended prototypes, as did MooTools. People still referred to making websites with JavaScript as 'DHTML', there was no trim method on strings, there wasn't even a forEach method on arrays. JavaScript was a crippled language. IE6 ruled the waves.
MooTools, Prototype, Dojo, Base2 - they made the language usable, even fun, to work with. By using an incredible feature of JavaScript, prototypical inheritance, we were able to add features to the language that made it palatable.
Be it simple methods like number.toInt, string.trim, array.forEach, or familiar programming constructs such as Class, MooTools and its ilk took JavaScript from something impossible to work with to something that you could properly use to build awesome sites, and even apps - Microsoft, IE and desktop ruled everything, and the concept of a 'web app' was but a pipedream at the time.
script.aculo.us, moofx and jQuery made it possible to animate things. We got selector engines. We got cross-browser XHR. All of a sudden JavaScript was a viable solution.
I honestly don't think JavaScript would be anywhere near what it is today if certain frameworks hadn't extended prototypes. Hindsight is a wonderful thing. If browser vendors (Microsoft) had been more committed to promoting the language, we wouldn't have had to.
It is very easy for people to slag off something built in a different era, a different industry, but I ask you this - the last time you made a website, how much of the code did you write? Did you use jQuery, require, nodeJS? Is it a Wordpress site, something built on Joomla, do you use LESS, Apache, npm? How many microframeworks do you use, powering important parts of your product, that you have no idea how it works, who wrote it, what problems they solved?
And in 8 year's time, do you expect all of the decisions you made today, with all of the work you've produced built on other's work, to still be 100% maintainable and function as you expected?
I spent so much of my time on MooTools - no regrets, I was trying to help the web, the language, in my own small way. Would I use it today? No. Do I regret any of our decisions? Some. Was it a bad thing for the Web? No.
Worst thing that we ever did? Extending Element prototype. Worst thing that happened to MooTools? Joomla adopting 1.1 for the backend. And then we changed API for v1.2.
We might one day scoff at the use of AMD and require.js when something better comes along. We might lol that people used JS animations instead of CSS animations. In 8 years time lol bitmaps why would you be so stupid to do that, why not use vector?
I have enjoyed the 'demise' of MooTools, something I spent so much of my time on. We became obsolete. That's great. The language evolved and we got the things we were looking for:
- String, Array, Number, Object extensions to make dealing with primitives workable - just basic programming methods like forEach
- querySelectorAll and - ahem - jQuery for sane DOM work (would still love to see more of this natively in browsers)
- Animations in CSS
- Cross-browser XHR
Amongst other things.
Prototype and MooTools and other frameworks that extended prototypes were great at the time, so great in fact that they became used by a huge part of the internet, at one point in time they have been the 'most used' frameworks, everyone was talking about how great the idea is, disclaimer - what is cool today will, in 8 years time, be uncool and oh god what a n00b what were they thinking?
Last point - I wonder how many JS devs today know who Dean Edwards is, or what Base2 or CSSQuery is. Probably not many. That's a shame.
Super late response, so sorry for digging it up--but such a great explanation and eye opening realization. Different times, no changes in sight. I for one didn't think even a couple years ago that we'd get any sort of "esnext" any time soon. Thank you for pushing the web forward, and I'm sorry everyone's efforts can't be realized as a necessary past time.
All that said, if anyone else is reading this--we're not in 2006 any more and you should not extend native prototypes in libraries for others. Do what you want in your own app (YOLO!), but don't be surprised if it breaks some day!