Skip to content

KBE3D / KBCore / Cesium / combine

函数: combine()

combine(object1?: any, object2?: any, deep?: boolean): any

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.

参数

object1?

any

The first object to merge.

object2?

any

The second object to merge.

deep?

boolean

Perform a recursive merge.

返回

any

The combined object containing all properties from both objects.

示例

ts
const object1 = {
    propOne : 1,
    propTwo : {
        value1 : 10
    }
}
const object2 = {
    propTwo : 2
}
const final = Cesium.combine(object1, object2);

// final === {
//     propOne : 1,
//     propTwo : {
//         value1 : 10
//     }
// }

KBE3D @3.0.0 Copyright © 2024-present KBE3D