how to create a object inside a map mjavas code example
Example 1: javascript map
function listFruits() {
let fruits = ["apple", "cherry", "pear"]
fruits.map((fruit, index) => {
console.log(index, fruit)
})
}
listFruits()
// https://jsfiddle.net/tmoreland/16qfpkgb/3/
Example 2: initialize a map js
let map = new Map()
map['bla'] = 'blaa'
map['bla2'] = 'blaaa2'
console.log(map) // Map { bla: 'blaa', bla2: 'blaaa2' }