Home How do I correctly clone a JavaScript object?
Reply: 0

How do I correctly clone a JavaScript object?

user417
1#
user417 Published in April 24, 2018, 8:29 am

I have an object, x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted properties. This isn't a problem, since I'm copying one of my own, literal-constructed objects.

How do I correctly clone a JavaScript object?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.614538 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO