how to replacea value of a map at a certain key code example
Example: javascript map replace key value
function mapReplace(map){
const x = new Map()
for (const [key, value] of map) {
x.set(value, key)
}
return x
}
function mapReplace(map){
const x = new Map()
for (const [key, value] of map) {
x.set(value, key)
}
return x
}