For other Methods of copying Object, you can refer to the following:
Advantages, Disadvantages of Cloning Object with JSON.stringify
Object.assign is used to copy the key value pair of one object to another. Lets look for the below code to understand the working of this keyword.
However, this keyword can also be used to copy the key value pairs from multiple Objects. After creating an empty Object, we can pass as many number of object as we want to this function. The key value pair of all these objects will be copied to this newly created Object. Lets see with the help of an Example below.