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