The Object assign() static method copies all enumerable and own properties from one or more source objects to a target object.

    
    const targetObject = { a: 1, b: 2 };
    const sourceObject = { b: 4, c: 5 };

    const combinedObject = Object.assign(targetObject, sourceObject);

    console.log(targetObject);
    // Object { a: 1, b: 4, c: 5 }

    console.log(combinedObject);
    // Object { a: 1, b: 4, c: 5 }