_.where

where_.where(list, properties) Looks through each value in the list, returning an array of all the values that contain all of the key-value pairs listed in properties. _.where(listOfPlays, {author: "Shakespeare", year: 1611}); => [{title: "Cymbeline", author: "Shakespeare", year: 1611}, {title: "The Tempest", author: "Shakespeare", year: 1611}]

_.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

_.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.

_.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" ...

_.flatten

flatten_.flatten(array, [shallow]) Flattens a nested array (the nesting can be to any depth). If you pass shallow, the array will only be flattened a single level. _.flatten([1, [2], [3, [[4]]]]); => [1, 2, 3, 4]; _.flatten([1, [2], [3, [[4]]]], true); => [1, 2, 3, [[4]]];

_.find

find_.find(list, predicate, [context]) Alias: detect Looks through each value in the list, returning the first one that passes a truth test (predicate), or undefined if no value passes the test. The function returns as soon as it finds an acceptable element, and doesn't traverse the entire list. var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); => 2

_.countBy

countBy_.countBy(list, iteratee, [context]) Sorts a list into groups and returns a count for the number of objects in each group. Similar to groupBy, but instead of returning a list of values, returns a count for the number of values in that group. _.countBy([1, 2, 3, 4, 5], function(num) { return num % 2 == 0 ? 'even': 'odd'; }); => {odd: 3, even: 2}

_.tail

rest_.rest(array, [index]) Alias: tail, drop Returns the rest of the elements in an array. Pass an index to return the values of the array from that index onward. _.rest([5, 4, 3, 2, 1]); => [4, 3, 2, 1]

_.memoize

memoize_.memoize(function, [hashFunction]) Memoizes a given function by caching the computed result. Useful for speeding up slow-running computations. If passed an optional hashFunction, it will be used to compute the hash key for storing the result, based on the arguments to the original function. The default hashFunction just uses the first argument to the memoized function as the key. The cache of memoized values is available as the cache property on the returned function. var fibonacci

_.unescape

unescape_.unescape(string) The opposite of escape, replaces &, <, >, ", ` and ' with their unescaped counterparts. _.unescape('Curly, Larry & Moe'); => "Curly, Larry & Moe"