The has() method of the Map object returns a boolean indicating whether value with the specified key exists in the map or not.
const map = new Map();
map.set('bar', 'foo');
console.log(map.has('bar'));
// true
console.log(map.has('apple'));
// false