TipsMap From-To ObjectMap From-To ObjectMap to Object const map = new Map([ ['name', 'Alice'], ['age', 25] ]); const obj = Object.fromEntries(map); console.log(obj); // { name: 'Alice', age: 25 } Object to Map const obj = { name: 'Alice', age: '25' }; const map = new Map(Object.entries(obj)); console.log(map); // Map(2) {'name' => 'Alice', 'age' => '25'}Last Update: 04:05 - 25 April 2024PreviousCreate array of n elementsNextObject has a property?On this page