let map1 = new Map();
map1.set('info', {name: 'Jack', age: "26"});
// removing a particular element
map1.delete('address'); // false
console.log(map1); // Map {"info" => {name: "Jack", age: "26"}}
map1.delete('info'); // true
console.log(map1); // Map {}
// You should use the filter method rather than map unless you want
// to mutate the items in the array, in addition to filtering.
// eg.
let filteredItems = items.filter(function(item)
{
return ...some condition...;
});
Object.keys(map).forEach(function (key) {
if(key.match('^'+letter)) delete obj[key];
});