mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Use consistent nullish check for array.
This commit is contained in:
@@ -22,7 +22,7 @@ import baseWhile from './.internal/baseWhile.js'
|
||||
* // => objects for ['barney', 'fred']
|
||||
*/
|
||||
function takeWhile(array, predicate) {
|
||||
return (array && array.length)
|
||||
return (array != null && array.length)
|
||||
? baseWhile(array, predicate)
|
||||
: []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user