📅  最后修改于: 2022-03-11 15:01:51.808000             🧑  作者: Mango
const map1 = new Map([
['foo', 'bar'],
['baz', 42]
]);
const obj = Object.fromEntries(map1);
// { foo: 'bar', baz: 42 }
//To get back the map:
const map2 = new Map(Object.entries(obj));