📅  最后修改于: 2022-03-11 15:01:07.411000             🧑  作者: Mango
var keys = ['a', 'b', 'c'],
values = [1, 2, 3],
associated = keys.reduce(function (previous, key, index) {
previous[key] = values[index];
return previous
}, {})
console.log(associated) // Object {a: 1, b: 2, c: 3}