_.take

first_.first(array, [n]) Alias: head, take Returns the first element of an array. Passing n will return the first n elements of the array. _.first([5, 4, 3, 2, 1]); => 5

_.property

property_.property(key) Returns a function that will itself return the key property of any passed-in object. var stooge = {name: 'moe'}; 'moe' === _.property('name')(stooge); => true

_.clone

clone_.clone(object) Create a shallow-copied clone of the provided plain object. Any nested objects or arrays will be copied by reference, not duplicated. _.clone({name: 'moe'}); => {name: 'moe'};

_.isEqual

isEqual_.isEqual(object, other) Performs an optimized deep comparison between the two objects, to determine if they should be considered equal. var stooge = {name: 'moe', luckyNumbers: [13, 27, 34]}; var clone = {name: 'moe', luckyNumbers: [13, 27, 34]}; stooge == clone; => false _.isEqual(stooge, clone); => true

_.map

map_.map(list, iteratee, [context]) Alias: collect Produces a new array of values by mapping each value in list through a transformation function (iteratee). The iteratee is passed three arguments: the value, then the index (or key) of the iteration, and finally a reference to the entire list. _.map([1, 2, 3], function(num){ return num * 3; }); => [3, 6, 9] _.map({one: 1, two: 2, three: 3}, function(num, key){ return num * 3; }); => [3, 6, 9] _.map([[1, 2], [3, 4]], _.first); => [1

_.bind

bind_.bind(function, object, *arguments) Bind a function to an object, meaning that whenever the function is called, the value of this will be the object. Optionally, pass arguments to the function to pre-fill them, also known as partial application. For partial application without context binding, use partial. var func = function(greeting){ return greeting + ': ' + this.name }; func = _.bind(func, {name: 'moe'}, 'hi'); func(); => 'hi: moe'

_.keys

keys_.keys(object) Retrieve all the names of the object's own enumerable properties. _.keys({one: 1, two: 2, three: 3}); => ["one", "two", "three"]

_.times

times_.times(n, iteratee, [context]) Invokes the given iteratee function n times. Each invocation of iteratee is called with an index argument. Produces an array of the returned values. Note: this example uses the object-oriented syntax. _(3).times(function(n){ genie.grantWishNumber(n); });

_.noConflict

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

_.defer

defer_.defer(function, *arguments) Defers invoking the function until the current call stack has cleared, similar to using setTimeout with a delay of 0. Useful for performing expensive computations or HTML rendering in chunks without blocking the UI thread from updating. If you pass the optional arguments, they will be forwarded on to the function when it is invoked. _.defer(function(){ alert('deferred'); }); // Returns from the function before the alert runs.