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

_.shuffle

shuffle_.shuffle(list) Returns a shuffled copy of the list, using a version of the Fisher-Yates shuffle. _.shuffle([1, 2, 3, 4, 5, 6]); => [4, 1, 6, 3, 5, 2]

_.pluck

pluck_.pluck(list, propertyName) A convenient version of what is perhaps the most common use-case for map: extracting a list of property values. var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; _.pluck(stooges, 'name'); => ["moe", "larry", "curly"]

_.range

range_.range([start], stop, [step]) A function to create flexibly-numbered lists of integers, handy for each and map loops. start, if omitted, defaults to 0; step defaults to 1. Returns a list of integers from start (inclusive) to stop (exclusive), incremented (or decremented) by step, exclusive. Note that ranges that stop before they start are considered to be zero-length instead of negative â if you'd like a negative range, use a negative step. _.range(10); => [0, 1, 2, 3, 4, 5, 6,

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

_.propertyOf

propertyOf_.propertyOf(object) Inverse of _.property. Takes an object and returns a function which will return the value of a provided property. var stooge = {name: 'moe'}; _.propertyOf(stooge)('name'); => 'moe'

_.random

random_.random(min, max) Returns a random integer between min and max, inclusive. If you only pass one argument, it will return a number between 0 and that number. _.random(0, 100); => 42

_.pick

pick_.pick(object, *keys) Return a copy of the object, filtered to only have values for the whitelisted keys (or array of valid keys). Alternatively accepts a predicate indicating which keys to pick. _.pick({name: 'moe', age: 50, userid: 'moe1'}, 'name', 'age'); => {name: 'moe', age: 50} _.pick({name: 'moe', age: 50, userid: 'moe1'}, function(value, key, object) { return _.isNumber(value); }); => {age: 50}

_.reject

reject_.reject(list, predicate, [context]) Returns the values in list without the elements that the truth test (predicate) passes. The opposite of filter. var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); => [1, 3, 5]

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