method URL.toStringURL.toString(): stringThe toString() method of the URL interface returns a string containing the complete URL. ExamplesExample 1 const myURL = new URL('https://foo.example.org/bar'); console.log(myURL.toString()); // Logs "https://foo.example.org/bar" Return TypestringSeehttps://developer.mozilla.org/docs/Web/API/URL/toString