Deep clone of object.
Like JSON.parse(JSON.stringify(obj)), but supports basic javascript types (string, number, object), Date and RegExps and cycles.
JSON.parse(JSON.stringify(obj))
Date
RegExp
Throws error if enounters object with prototype assuming that in general class instances cannot be reliably cloned by generic algorithm.
prototype
Deep clone of object.
Like
JSON.parse(JSON.stringify(obj)), but supports basic javascript types (string, number, object),DateandRegExps and cycles.Throws error if enounters object with
prototypeassuming that in general class instances cannot be reliably cloned by generic algorithm.