Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript map replace key value

function mapReplace(map){
const x = new Map()
for (const [key, value] of map) {
  x.set(value, key)
}    
return x
}
 
PREVIOUS NEXT
Tagged: #javascript #map #replace #key
ADD COMMENT
Topic
Name
5+6 =