Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Js

Idiom #311 Deep copy an object

Create the new object y by cloning the all the contents of x, recursively.

let y = structuredClone(x);
classes
var
  x,y: TPersistent;
...
  y.assign(x);
...

New implementation...
< >
programming-idioms.org