What is copying and how does it Work in JS?
In JavaScript, Copying is the process of making duplicate of of an existing values like integer, string, objects and function.
However this is not so easy and straightforward as it looks. It all depends upon either you are copying primitive data types or non-primitive data types. If you are copying a primitive data type then it would be working with primary value but in the case of non-primitive data types it work with referenced values.
Lets see how it works with primary value and the referenced values
Primitive Value (Copy By Value)






