_.indexOf

indexOf_.indexOf(array, value, [isSorted]) Returns the index at which value can be found in the array, or -1 if value is not present in the array. If you're working with a large array, and you know that the array is already sorted, pass true for isSorted to use a faster binary search ... or, pass a number as the third argument in order to look for the first matching value in the array after the given index. _.indexOf([1, 2, 3], 2); => 1

_.intersection

intersection_.intersection(*arrays) Computes the list of values that are the intersection of all the arrays. Each value in the result is present in each of the arrays. _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); => [1, 2]

_.indexBy

indexBy_.indexBy(list, iteratee, [context]) Given a list, and an iteratee function that returns a key for each element in the list (or a property name), returns an object with an index of each item. Just like groupBy, but for when you know your keys are unique. var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; _.indexBy(stooges, 'age'); => { "40": {name: 'moe', age: 40}, "50": {name: 'larry', age: 50}, "60": {name: 'curly', age: 60} }

_.identity

identity_.identity(value) Returns the same value that is used as the argument. In math: f(x) = x This function looks useless, but is used throughout Underscore as a default iteratee. var stooge = {name: 'moe'}; stooge === _.identity(stooge); => true

_.reduce

reduce_.reduce(list, iteratee, [memo], [context]) Aliases: inject, foldl Also known as inject and foldl, reduce boils down a list of values into a single value. Memo is the initial state of the reduction, and each successive step of it should be returned by iteratee. The iteratee is passed four arguments: the memo, then the value and index (or key) of the iteration, and finally a reference to the entire list. If no memo is passed to the initial invocation of reduce, the iteratee is not invo

_.has

has_.has(object, key) Does the object contain the given key? Identical to object.hasOwnProperty(key), but uses a safe reference to the hasOwnProperty function, in case it's been overridden accidentally. _.has({a: 1, b: 2, c: 3}, "b"); => true

_.groupBy

groupBy_.groupBy(list, iteratee, [context]) Splits a collection into sets, grouped by the result of running each value through iteratee. If iteratee is a string instead of a function, groups by the property named by iteratee on each of the values. _.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); }); => {1: [1.3], 2: [2.1, 2.4]} _.groupBy(['one', 'two', 'three'], 'length'); => {3: ["one", "two"], 5: ["three"]}

_.methods

functions_.functions(object) Alias: methods Returns a sorted list of the names of every method in an object â that is to say, the name of every function property of the object. _.functions(_); => ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...

_.reduceRight

reduceRight_.reduceRight(list, iteratee, memo, [context]) Alias: foldr The right-associative version of reduce. Foldr is not as useful in JavaScript as it would be in a language with lazy evaluation. var list = [[0, 1], [2, 3], [4, 5]]; var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); => [4, 5, 2, 3, 0, 1]

_.findWhere

findWhere_.findWhere(list, properties) Looks through the list and returns the first value that matches all of the key-value pairs listed in properties. If no match is found, or if list is empty, undefined will be returned. _.findWhere(publicServicePulitzers, {newsroom: "The New York Times"}); => {year: 1918, newsroom: "The New York Times", reason: "For its public service in publishing in full so many official reports, documents and speeches by European statesmen relating to the pro