_.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); });

_.size

size_.size(list) Return the number of values in the list. _.size({one: 1, two: 2, three: 3}); => 3

_.isString

isString_.isString(object) Returns true if object is a String. _.isString("moe"); => true

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

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

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

_.chain

chain_.chain(obj) Returns a wrapped object. Calling methods on this object will continue to return wrapped objects until value is called. var stooges = [{name: 'curly', age: 25}, {name: 'moe', age: 21}, {name: 'larry', age: 23}]; var youngest = _.chain(stooges) .sortBy(function(stooge){ return stooge.age; }) .map(function(stooge){ return stooge.name + ' is ' + stooge.age; }) .first() .value(); => "moe is 21"

_.result

result_.result(object, property, [defaultValue]) If the value of the named property is a function then invoke it with the object as context; otherwise, return it. If a default value is provided and the property doesn't exist or is undefined then the default will be returned. If defaultValue is a function its result will be returned. var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }}; _.result(object, 'cheese'); => "crumpets" _.result(object, 'stuff'); => "nonse

_.compact

compact_.compact(array) Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "", undefined and NaN are all falsy. _.compact([0, 1, false, 2, '', 3]); => [1, 2, 3]