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

2
sum.js
View File

@@ -13,7 +13,7 @@ import baseSum from './.internal/baseSum.js'
* // => 20
*/
function sum(array) {
return (array && array.length)
return (array != null && array.length)
? baseSum(array, value => value)
: 0
}