Make JS mo' fun by writing less of it via functional programming
note: not actively maintained...
mofun.js is special because it's a vanilla-flavored collection of stand-alone functions. Most of the functions use this to avoid hard-coding a one-off anonymous function for a simple sub-task. Think of this in JS as a function argument that gets called in a different way than the formal parameters (since that's exactly what this is). By using this to send one more customization to the function logic, generic functions become viable in a whole lot of places that used to require a customized anonymous function. In short, the literal "function" will appear a lot less in code using mofun.
mofun.js is not a functional framework like Prototype.js, Oliver Steele's functional, Underscore.js, or jQuery. To use most of the functions in mofun.js, you'll need to pass them to existing higher-order functions like vanilla's .map() and .filter(), or to an existing framework method like _.map(), or even $.map(). Most of the included functions are pure functions, which execute quickly, have no side-effects or dependencies, and are inherently testable. None of mofun's methods have any internal dependencies. Cut and paste them ad-hoc from the listing below if you don't want/need them all. Since it's all based on pure vanilla, you can rip the library apart and like the T-1000, each little piece survives and works independently.
<script src=mofun.min.js></script> (as _window.F or AMD name)
npm install mofun
Visit the project page for examples, annoted source, and more