Object.update

Object.update

Object.update

Function

Merge one or more objects into the current object in place.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
sourceNObjectNoNoneThe source object to merge; non-object arguments are ignored.

Return value

TypeDescription
ObjectReturns the original object to facilitate continued chain calls.

Return object fields

update() returns the same object reference that it was called on. The returned object first retains the original fields, and then writes the fields of each source object in parameter order; fields with the same name are overwritten by the source object written later.

Example

Notes

  • update will modify the original object.
  • update will refuse to write values that would create circular references.