_.take

_.take(array, [n=1]) source npm package Creates a slice of array with n elements taken from the beginning. Since 0.1.0 Arguments array (Array): The array to query. [n=1] (number): The number of elements to take. Returns (Array): Returns the slice of array. Example _.take([1, 2, 3]); // => [1]   _.take([1, 2, 3], 2); // => [1, 2]   _.take([1, 2, 3], 5); // => [1, 2, 3]   _.take([1, 2, 3], 0); // => []

_.tail

_.tail(array) source npm package Gets all but the first element of array. Since 4.0.0 Arguments array (Array): The array to query. Returns (Array): Returns the slice of array. Example _.tail([1, 2, 3]); // => [2, 3]

_.sumBy

_.sumBy(array, [iteratee=_.identity]) source npm package This method is like _.sum except that it accepts iteratee which is invoked for each element in array to generate the value to be summed. The iteratee is invoked with one argument: (value). Since 4.0.0 Arguments array (Array): The array to iterate over. [iteratee=_.identity] (Function): The iteratee invoked per element. Returns (number): Returns the sum. Example var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];   _.sumB

_.sum

_.sum(array) source npm package Computes the sum of the values in array. Since 3.4.0 Arguments array (Array): The array to iterate over. Returns (number): Returns the sum. Example _.sum([4, 2, 8, 6]); // => 20

_.subtract

_.subtract(minuend, subtrahend) source npm package Subtract two numbers. Since 4.0.0 Arguments minuend (number): The first number in a subtraction. subtrahend (number): The second number in a subtraction. Returns (number): Returns the difference. Example _.subtract(6, 4); // => 2

_.stubTrue

_.stubTrue() source npm package This method returns true. Since 4.13.0 Returns (boolean): Returns true. Example _.times(2, _.stubTrue); // => [true, true]

_.stubString

_.stubString() source npm package This method returns an empty string. Since 4.13.0 Returns (string): Returns the empty string. Example _.times(2, _.stubString); // => ['', '']

_.stubObject

_.stubObject() source npm package This method returns a new empty object. Since 4.13.0 Returns (Object): Returns the new empty object. Example var objects = _.times(2, _.stubObject);   console.log(objects); // => [{}, {}]   console.log(objects[0] === objects[1]); // => false

_.stubFalse

_.stubFalse() source npm package This method returns false. Since 4.13.0 Returns (boolean): Returns false. Example _.times(2, _.stubFalse); // => [false, false]

_.stubArray

_.stubArray() source npm package This method returns a new empty array. Since 4.13.0 Returns (Array): Returns the new empty array. Example var arrays = _.times(2, _.stubArray);   console.log(arrays); // => [[], []]   console.log(arrays[0] === arrays[1]); // => false