How to check for a hash in URL using JavaScript

How to check for a hash in URL using JavaScript