Is there a more straightforward way in lodash to achieve the following,
var o = _.reduce([2, 3, 7], function(acc, v, i) {
acc[v] = i || "0";
return acc;
}, {});
Result,
Object {2: "0", 3: 1, 7: 2}
Is there a more straightforward way in lodash to achieve the following,
var o = _.reduce([2, 3, 7], function(acc, v, i) {
acc[v] = i || "0";
return acc;
}, {});
Result,
Object {2: "0", 3: 1, 7: 2}