The DOMRectReadOnly method toJSON() returns a JSON representation of the DOMRectReadOnly object.
toJSON()
DOMRectReadOnly
MDN Reference