Make_.dropRight, _.dropRightWhile, _.takeRight, and _.takeRightWhile their own methods.

This commit is contained in:
John-David Dalton
2014-03-04 09:40:48 -08:00
parent b4ff8360ba
commit c4c0c050af
7 changed files with 588 additions and 134 deletions

View File

@@ -1151,6 +1151,9 @@
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3], 1);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
@@ -1595,13 +1598,16 @@
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3], 1);
* // => [2]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], -1);
* _.take([1, 2, 3], 0);
* // => []
*/
var take = first;