📅  最后修改于: 2022-03-11 15:03:56.278000             🧑  作者: Mango
var obj = { foo: 'bar', baz: 42 };
console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ]
for(const [i, val] of Object.entries(obj))
new_obj[i] = val;