The path of the URL.
let url = new URL("https://example.com/api/users?id=123") url.pathname
"/api/users"
let url = new URL("https://example.com") url.pathname = "/new/path" url.href
"https://example.com/new/path"