I have not found, what thing returns if I do:
if (window.location.hash = '')
Being the web http://eduard.com
I have not found, what thing returns if I do:
if (window.location.hash = '')
Being the web http://eduard.com
You should not return anything with that URL
, the hash
as its name indicates it gets the #
and what is after this
Ejm
http://eduard.com // retorna vacío
http://eduard.com#hola // retorna #hola
The value that returns if there is no hash will be an empty string , a way to check the return value would be
var x = window.location.hash;
console.log(typeof x); // return string
Another thing to keep in mind is that in if
the comparison would be with ==
, that is
if (window.location.hash == ''){... //Sin Hash}