Javascript
Thursday, October 11, 2018
Copy object
If you want shallow copy, use
Object.assign({}, a)
For "deep" copy, use
JSON.parse(JSON.stringify(a))
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment