mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Ensure _.map rewrite handles objects with non-numeric length properties correctly.
Former-commit-id: 60a4f322dcd284db5bb8ad4d8d5138e52e14cce3
This commit is contained in:
@@ -2081,7 +2081,7 @@
|
||||
function map(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = collection ? collection.length : 0,
|
||||
result = Array(length);
|
||||
result = Array(typeof length == 'number' ? length : 0);
|
||||
|
||||
callback = createCallback(callback, thisArg);
|
||||
if (isArray(collection)) {
|
||||
|
||||
Reference in New Issue
Block a user