Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces
2.1.51 (release candidate)
collection
interactivityModel
Interfaces

util.extend

Static function.

Function that copies properties from one or several JavaScript objects to another JavaScript object.

util.extend(target, source)

Parameters:

ParameterDefault valueDescription
target*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

Target JavaScript object. It will be modified as a result of the function.

source*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

Source JavaScript object. All of its properties will be copied. There can be several sources (the function can have any number of parameters), and data is copied from right to left (the last argument has highest priority during copying).

* Mandatory parameter/option.

Example:

var options = ymaps.util.extend({
     prop1: 'a',
     prop2: 'b'
}, {
     prop2: 'c',
     prop3: 'd'
}, {
     prop3: 'e'
});
// We get the result: {
//     prop1: 'a',
//     prop2: 'c',
//     prop3: 'e'
// }