The get() method of the Map object returns the value of the given key.

    
    const map = new Map();

    map.set('bar', 'foo');

    const person = map.get('bar');

    console.log(person);
    // "foo"

    console.log(map.get('apple'));
    // undefined