var arr = ['a', 'b', 'c']
var arr2 = [7, 2, 5]
var obj={
'a' : 7,
'b' : 2,
'c' : 5
}
const obj = Object.assign({}, ...arr.map((n, i) => ({ [n]: arr2[i] })));
// или
const obj = arr.reduce((acc, n, i) => ({ ...acc, [n]: arr2[i] }), {});
const combine = (keys, values) =>
keys.reduce((acc, n, i) => (acc[n] = values[i], acc), {});
const obj = combine(arr, arr2);
_.object = function(list, values) {
var result = {};
for (var i = 0; i < list.length; i++) {
result[list[i]] = values[i];
}
return result;
};