📅  最后修改于: 2022-03-11 15:03:31.191000             🧑  作者: Mango
const obj = { foo: 'bar', baz: 42 };
Object.entries(obj).forEach(([key, value]) => console.log(`${key}: ${value}`)); // "foo: bar", "baz: 42"