mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
cleaned up key check in groupBy
This commit is contained in:
@@ -256,12 +256,7 @@
|
|||||||
var result = {};
|
var result = {};
|
||||||
each(obj, function(value) {
|
each(obj, function(value) {
|
||||||
var key = iterator(value);
|
var key = iterator(value);
|
||||||
if (result.hasOwnProperty(key)) {
|
(result[key] || (result[key] = [])).push(value)
|
||||||
result[key].push(value);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result[key] = [value];
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user