Deep clones obj and keeps the shape of what it reaches: an object reached twice is cloned once, cycles are kept,
and class instances (including those of Map, Set, and Array subclasses) keep their prototype.
Functions, and every object keep says so of, are shared by reference instead of cloned.
fields may state for a class instance which of its properties are left out or copied in a way of their own, see ClonedFields.
Deep clones
objand keeps the shape of what it reaches: an object reached twice is cloned once, cycles are kept, and class instances (including those ofMap,Set, andArraysubclasses) keep their prototype. Functions, and every objectkeepsays so of, are shared by reference instead of cloned.fieldsmay state for a class instance which of its properties are left out or copied in a way of their own, see ClonedFields.