mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Use arrayReduce in basePick.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -2315,18 +2315,12 @@
|
||||
*/
|
||||
function basePick(object, props) {
|
||||
object = Object(object);
|
||||
|
||||
var index = -1,
|
||||
length = props.length,
|
||||
result = {};
|
||||
|
||||
while (++index < length) {
|
||||
var key = props[index];
|
||||
return arrayReduce(props, function(result, key) {
|
||||
if (key in object) {
|
||||
result[key] = object[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}, {});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user