URL: toString() method - Web APIs | MDN
Syntax
Parameters
None.
Return value
A string.
Examples
js
const url = new URL(
"https://developer.mozilla.org/en-US/docs/Web/API/URL/toString",
);
url.toString(); // should return the URL as a string
Specifications
| Specification |
|---|
| URL # URL-stringification-behavior |
Browser compatibility
See also
- The
URLinterface it belongs to.