The structured clone algorithm - Web APIs | MDN
The structured clone algorithm copies complex JavaScript objects. It is used internally when invokingstructuredClone() , to transfer data between Workers via postMessage() , storing objects with IndexedDB, or copying objects for other APIs. It clones by recursing through the input object while maintaining a map of previously visited references, to avoid infinitely traversing cycles.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm