const
base1 = {
key1: 'value 1',
key2: 'value 2'
},
opt1 = base1 ??? {
key2:'value 2.1',
key3:'value 3.1'
},
opt2 = base1 ??? {
key2:'value 2.2',
key3:'value 3.2'
};
let obj1 = new MyObject('name1', opt1);
let obj2 = new MyObject('name1', opt2);
const commonOpt = {
key: 'val',
key1: 'val1'
}
const unitedOpt = {
...commonOpt,
key: 'lav'
}
const commonOpt = {
key: 'val',
key1: 'val1'
}
const unitedOpt = Object.assign(commonOpt, { key: 'lav' })