Reputation: 18186
Why is it that I can get the value of location.hash
when I call it like so:
> location.hash
"#my-hash-value"
But when I call it like so, it's undefined:
> var foo = location.hash
undefined
I'm missing something obvious. This is in Firefox.
Upvotes: 0
Views: 112
Reputation: 1025
The Statement doesn't return a value, but the variable is set. Try
console.log(a)
Upvotes: 2