If the hash value is undefined, then is incremented, the new value will be 1, which means the url has appeared once so far, which is corect.
There is no need to explicitly set each first-time occurence to 0, the counts will be the same either way, and MeowChow is correct.