The URL interface represents an object providing static methods used for creating object URLs.MDN Reference
The toString() method on the URL object returns the serialized URL. The value returned is equivalent to that of href and toJSON.