_.partial

partial_.partial(function, *arguments) Partially apply a function by filling in any number of its arguments, without changing its dynamic this value. A close cousin of bind. You may pass _ in your list of arguments to specify an argument that should not be pre-filled, but left open to supply at call-time. var subtract = function(a, b) { return b - a; }; sub5 = _.partial(subtract, 5); sub5(20); => 15 // Using a placeholder subFrom20 = _.partial(subtract, _, 20); subFrom20(5); => 15

_.pairs

pairs_.pairs(object) Convert an object into a list of [key, value] pairs. _.pairs({one: 1, two: 2, three: 3}); => [["one", 1], ["two", 2], ["three", 3]]

_.once

once_.once(function) Creates a version of the function that can only be called one time. Repeated calls to the modified function will have no effect, returning the value from the original call. Useful for initialization functions, instead of having to set a boolean flag and then check it later. var initialize = _.once(createApplication); initialize(); initialize(); // Application is only created once.

_.omit

omit_.omit(object, *keys) Return a copy of the object, filtered to omit the blacklisted keys (or array of keys). Alternatively accepts a predicate indicating which keys to omit. _.omit({name: 'moe', age: 50, userid: 'moe1'}, 'userid'); => {name: 'moe', age: 50} _.omit({name: 'moe', age: 50, userid: 'moe1'}, function(value, key, object) { return _.isNumber(value); }); => {name: 'moe', userid: 'moe1'}

_.object

object_.object(list, [values]) Converts arrays into objects. Pass either a single list of [key, value] pairs, or a list of keys, and a list of values. If duplicate keys exist, the last value wins. _.object(['moe', 'larry', 'curly'], [30, 40, 50]); => {moe: 30, larry: 40, curly: 50} _.object([['moe', 30], ['larry', 40], ['curly', 50]]); => {moe: 30, larry: 40, curly: 50}

_.now

now_.now() Returns an integer timestamp for the current time, using the fastest method available in the runtime. Useful for implementing timing/animation functions. _.now(); => 1392066795351

_.noop

noop_.noop() Returns undefined irrespective of the arguments passed to it. Useful as the default for optional callback arguments. obj.initialize = _.noop;

_.noConflict

noConflict_.noConflict() Give control of the _ variable back to its previous owner. Returns a reference to the Underscore object. var underscore = _.noConflict();

_.negate

negate_.negate(predicate) Returns a new negated version of the predicate function. var isFalsy = _.negate(Boolean); _.find([-2, -1, 0, 1, 2], isFalsy); => 0

_.mixin

mixin_.mixin(object) Allows you to extend Underscore with your own utility functions. Pass a hash of {name: function} definitions to have your functions added to the Underscore object, as well as the OOP wrapper. _.mixin({ capitalize: function(string) { return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); } }); _("fabio").capitalize(); => "Fabio"