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) { function basePick(object, props) {
object = Object(object); object = Object(object);
return arrayReduce(props, function(result, key) {
var index = -1,
length = props.length,
result = {};
while (++index < length) {
var key = props[index];
if (key in object) { if (key in object) {
result[key] = object[key]; result[key] = object[key];
} }
} return result;
return result; }, {});
} }
/** /**