var hashMap = {'key1': 'value1', 'key2': 'value2'};
function get(key) {
if (hashMap[key] == null) {
return null;
}
var value = hashMap[key];
delete hashMap[key];
return value;
}
get('key1'); // "value1"
get('key1'); // null
var elems = document.getElementsByClassName('counts');
for(i=0; i<elems.length; i++) {
elems[i].value = '99';
}