function sap/base/util/extend

Visiblity: public
Available since: N/A
Module: sap/base/util/extend
Application Component:

Performs object extension by merging source objects into a target object. Generates a shallow copy.

If during merging a key in the target object exists it is overwritten with the source object's value. Usage is the same as jQuery.extend(...). Values that are undefined are ignored.

As alternative you may also use Object.assign, but note that Object.assign only copies enumerable and own properties and doesn't copy properties on the prototype and non-enumerable properties. Also, values that are undefined are NOT ignored.

For deep copies, you may use sap/base/util/deepExtend.


Parameters Overview

Param Type Default Value Description
target object The object that will receive new properties
source? object One or more objects which get merged into the target object

Methods Overview

Method Description