const map1 = new Map();
map1.set('bar', 'foo');
console.log(map1.delete('bar'));
// expected result: true
// (true indicates successful removal)
console.log(map1.has('bar'));
// expected result: false
/*Suppose a map*/
Map<T> map = new HashMap<>();
/*Insert 2 keys, and remove one*/
map.put('First', 'John');
map.put('Second', 'Tommy');
// Returns a value, you don't have to save it if you want
String removedValue = map.remove('First');