Update _.map to return an empty array when falsey values are passed.

Former-commit-id: 2f091fbeb140cbc0b8f3bd2df7a449a06239be0b
This commit is contained in:
John-David Dalton
2012-10-06 21:11:52 -07:00
parent c33825a904
commit 17e113dafb
4 changed files with 19 additions and 19 deletions

View File

@@ -482,7 +482,7 @@
/** Reusable iterator options for `invoke`, `map`, `pluck`, and `sortBy` */
var mapIteratorOptions = {
'init': false,
'init': 'collection || []',
'beforeLoop': {
'array': 'result = Array(length)',
'object': 'result = ' + (isKeysFast ? 'Array(length)' : '[]')