On composition and currying in JavaScript

Functional Composition, starting à la carte. Composition is a core concept of functional programming. Wikipedia defines function composition as follows: In computer science, function composition (not »

Homemade Curry

Lots of "functional programming utility libraries" (LoDash, Ramda, et. all) have a curry method. curry is quite powerful, as it allows you to build out a »

Array.reduce to populate an object

An easy way to populate an object from a collection is to use reduce: var collection = [{id: 1, value: 'foo'}, {id: 2, value: 'bar'}]; var result »

The difference between partial application and currying

Partial application and currying are often confused, but are in fact quite different. Let's use lodash to illustrate the difference between partial application and currying. function »

Short Circuit Array iterations with Array.some

ES5 has some nice features, but one thing that isn't immediately obvious is how to exit a loop early using one of the array iteration methods. »