src code

class method Object.clone

Object.clone(object) → Object
  • object (Object) – The object to clone.

Duplicates the passed object.

Copies all the original's key/value pairs onto an empty object.

Do note that this is a shallow copy, not a deep copy. Nested objects will retain their references.