Hmmm... Ich find's ja schöner so:

counter[group] = (counter[group] === undefined) ? 0 : counter[group] + 1

(oder andersrum)