Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In one of my recent interviews i was asked "What is Object.assign() method in Angular ?"
At that time i was not clear with my answer and replied that it is used to copy data from one object to another but there after i got a new question "What is the difference between deep copy and shallow copy ?" there i got stuck.

What I have tried:

It is used to copy data from one object to another but there after i got a new question What is the difference between deep copy and shallow copy
Posted
Updated 9-Jan-20 1:35am
Comments
Patrice T 9-Jan-20 6:49am    
And you can't read Angular documentation ?
ZurdoDev 9-Jan-20 7:53am    
What they said. ^

Also, your title is misleading.
Afzaal Ahmad Zeeshan 9-Jan-20 8:04am    
That is a JavaScript function and Angular uses that. So check MDN documentation for that.

Try to read this link carefully,ist explain object.asign method in detail

https://angular-2-training-book.rangle.io/immutable/javascript-solutions/object_assign[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900