Carte JavaScript Remplacer la valeur de la clé

function mapReplace(map){
const x = new Map()
for (const [key, value] of map) {
  x.set(value, key)
}    
return x
}
David Diamant