The easiest way to copy object properties on to another is Object.assign()
Example:
function obj1(){
let target = { a: 1, b: 2 };
return target;
}
function obj2(){
let source = { b: 4, c: 5 };
let new_source = Object.assign(obj1(), source);
new_source.d = "Hello"; //add a new property
console.log(new_source); //Output : Object { a: 1, b: 4, c: 5, d:
" Hello" }
}