globalsURL()prototypeURL.toJSON()Version: 3.28.0On this pageURL.toJSON()The toJSON() method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().SyntaxtoJSON()ParametersNone.Return valueA string.