Soumil Roy

Copying nested objects in JS the right way

One of the most yucky way to copy an object, especially nest objects was JSON stringifying and decoding it. This method is bad whenever you’re trying to copy Date or Set types.

This article by show an excellent way to clone said objects using structuredClone available both on Node and the browser.