_.sample

sample_.sample(list, [n]) Produce a random sample from the list. Pass a number to return n random elements from the list. Otherwise a single random item will be returned. _.sample([1, 2, 3, 4, 5, 6]); => 4 _.sample([1, 2, 3, 4, 5, 6], 3); => [1, 6, 2]

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

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

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

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

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

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

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

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

_.partition

partition_.partition(array, predicate) Split array into two arrays: one whose elements all satisfy predicate and one whose elements all do not satisfy predicate. _.partition([0, 1, 2, 3, 4, 5], isOdd); => [[1, 3, 5], [0, 2, 4]]