It would be better if you convert array's value into integer and increment it. It will be robust code.
By default array's value is string. so in case you do not convert it to integer then it might not work cross browser.
if (map[key] == null) map[key] = 0;
map[key] = parseInt(map[key])+1;