Deep and Shallow Copy with Object.assign JavaScript
Working with JavaScript Object.assign Function
TechnoFunnel presents another article focussed on Cloning an Object using Object.assign Function in JavaScript. Object.assign is another great way to copy the object into some other Object. We will look whether we can perform Deep or Shallow Copy using this method.
For other Methods of copying Object, you can refer to the following:
What is Object.assign in JavaScript
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.