When only hash changed (example: from '#hash1' to '#hash2'), previous url didn't update. And when we again changed hash to '#hash1', we have behaviour such as we changed not only hash, because condition url.hash !== previousUrl.hash isn't true (we have: url.hash == '#hash1' and previousUrl.hash == '#hash1').
When only hash changed (example: from '#hash1' to '#hash2'), previous url didn't update. And when we again changed hash to '#hash1', we have behaviour such as we changed not only hash, because condition url.hash !== previousUrl.hash isn't true (we have: url.hash == '#hash1' and previousUrl.hash == '#hash1').