Remove coercion method use.

This commit is contained in:
John-David Dalton
2017-03-13 20:49:45 -07:00
parent 2f281c68b0
commit bb7c959479
33 changed files with 59 additions and 194 deletions

View File

@@ -1,5 +1,4 @@
import baseSlice from './.internal/baseSlice.js'
import toInteger from './toInteger.js'
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
@@ -25,11 +24,9 @@ import toInteger from './toInteger.js'
*/
function drop(array, n=1) {
const length = array == null ? 0 : array.length
if (!length) {
return []
}
n = toInteger(n)
return baseSlice(array, n < 0 ? 0 : n, length)
return length
? baseSlice(array, n < 0 ? 0 : n, length)
: []
}
export default drop