Use consistent nullish check for array.

This commit is contained in:
John-David Dalton
2017-02-28 13:39:50 -08:00
parent 46ffbc1d90
commit d0f23b67ac
21 changed files with 21 additions and 21 deletions

View File

@@ -25,7 +25,7 @@ import toInteger from './toInteger.js'
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
if (!(array != null && array.length)) {
return []
}
n = (guard || n === undefined) ? 1 : toInteger(n)