📜  来自两个数组的 javascript 字典 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:10.190000             🧑  作者: Mango

代码示例1
var keys = ['foo', 'bar', 'baz'];
var values = [11, 22, 33]

var result = {};
keys.forEach((key, i) => result[key] = values[i]);
console.log(result);