The set() method of the Map object adds (or updates) an entry in the map with a specified key and value.

    
    const map = new Map();

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

    console.log(map.get('bar'));
    // "foo"