// Convert to JSON string
const jsonStr = JSON.stringify(Object.fromEntries(map));
// 👇️ ‘{“name”: “Tom”, “country”: “Chile”}’
//將string --> Object --> Map
const obj = JSON.parse(jsonStr);
const mapAgain = new Map(Object.entries(obj));
console.log(mapAgain); // 👉️ {‘name’ => ‘Tom’, ‘country’ => ‘Chile’}