property URL.hash
The hash property of the URL interface is a string that starts with a #
and is followed by the fragment identifier of the URL.
It returns an empty string if the URL does not contain a fragment identifier.
Examples #
#
const myURL = new URL('https://example.org/foo#bar');
console.log(myURL.hash); // Logs "#bar"
const myOtherURL = new URL('https://example.org');
console.log(myOtherURL.hash); // Logs ""
Type #
string