toJSON

The toJSON() method of the GeolocationPosition interface is a Serialization; it returns a JSON representation of the GeolocationPosition object.

MDN Reference