Merges two objects, copying their properties onto a new combined object. When two objects have the same
property, the value of the property on the first object is used. If either object is undefined,
it will be treated as an empty object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
object1 |
Object |
<optional> |
The first object to merge. | |
object2 |
Object |
<optional> |
The second object to merge. | |
deep |
Boolean |
<optional> |
false | Perform a recursive merge. |
- Source:
Returns:
The combined object containing all properties from both objects.
- Type
- Object
Example
var object1 = {
propOne : 1,
propTwo : {
value1 : 10
}
}
var object2 = {
propTwo : 2
}
var final = Cesium.combine(object1, object2);
// final === {
// propOne : 1,
// propTwo : {
// value1 : 10
// }
// }