property URL.pathname
The pathname
property of the URL interface is a string that represents the path of the URL.
Examples #
#
const myURL = new URL('https://example.org/foo/bar');
console.log(myURL.pathname); // Logs "/foo/bar"
const myOtherURL = new URL('https://example.org');
console.log(myOtherURL.pathname); // Logs "/"
Type #
string