var target = {a: 1};
var source = {b: 2};
Object.assign(target, source)
var target = {a: 1, b: 2};
var source1 = {b: 2, c: 3};
var source2 = {c: 4, d: 5};
Object.assign(target, source1, source2)
var target = {a: 1};
Object.assign(target)
Object.assign(undefined)
Object.assign(null)
var target = {a: 1};
Object.assign(target, undefined)
Object.assign(target, null)
var str = 'abc';
var bool = true
var num = 10;
Object.assign(str)
Object.assign(bool)
Object.assign(num)
Object.assign({}, str, bool, num);
var obj1 = {a: {b: 1}}
var obj2 = Object.assign({}, obj1);
obj1.a.b
obj2.a.b
var obj1 = {a: {b: 1, c: 2}}
var obj2 = {a: {b: 'hello'}}
Object.assign(obj1, obj2);