Map.prototype.get

Returns the value associated with the given key, or undefined if there is none.

Syntax

get(key)

Parameters

Examples

const map = new Map()
map.set("myKey", "myValue")
map.get("myKey")
"myValue"