Use arrayReduce in basePick.

This commit is contained in:
John-David Dalton
2015-08-30 03:39:07 -07:00
parent ecd8b7f614
commit 7d6fcc75da

View File

@@ -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;
}, {});
}
/**