Remove guard params.

This commit is contained in:
John-David Dalton
2017-03-05 02:37:18 -08:00
parent 89829331f0
commit bda6d56c60
14 changed files with 22 additions and 41 deletions

View File

@@ -8,7 +8,6 @@ import toInteger from './toInteger.js'
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
@@ -24,11 +23,11 @@ import toInteger from './toInteger.js'
* take([1, 2, 3], 0)
* // => []
*/
function take(array, n, guard) {
function take(array, n=1) {
if (!(array != null && array.length)) {
return []
}
n = (guard || n === undefined) ? 1 : toInteger(n)
n = toInteger(n)
return baseSlice(array, 0, n < 0 ? 0 : n)
}