how to create a map from an array using JavaScript

 

Two dimensional array can be converted in map 

const array = [
  ['name', 'rehan'],
  ['age', 34],
];
const map = new Map(array);

console.log(map);

Tags:

Share:

Related posts