Better to just return the value; the `returnValue` variable isn't necessary.

```
if (includeHashInUrl) {
  return location.href;
}
return location.href.replace(/#.*/, "");