The following adds an endsWith method to any string. Requires underscore.js. if (typeof String.prototype.endsWith === ‘undefined’) { String.prototype.endsWith = function(suffix) […]

Underscore 1.6.0 did something ingenious. Instead of implementing the long-awaited _.partialRight method from lodash (very useful for binding callbacks!) Sergey […]

http://runnable.com/U5xjrghR-NEC1pOa/_-trampoline-example-for-node-js Based on http://raganwald.com/2013/03/28/trampolines-in-javascript.html function factorial(n) { var _factorial = function myself(acc, n) { return n ? function() { return […]

The async library provides invaluable utilities for wrangling multi-step asynchronous tasks: function copyFile (src, dst, done) { async.waterfall([ function (callback) […]

Why we need bind From this function hello(thing) { console.log(“Hello ” + thing); } // this: hello(“world”) // desugars to: […]