function removeKeyEndWith(obj, letter) { Object.keys(obj).forEach(function (key) { if(key.match(letter+'$')) delete obj[key]; }); } var map = new Object(); map['aaa'] = "aaaa"; map['bbb'] = "bbbb"; map['cccRef'] = "CCCC"; map['dddRef'] = "DDDDD"; console.log(map); removeKeyEndWith(map, 'Ref'); console.log(map);