Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L N ]
- ()il ol shf SR B THE A ) s e g R A (Rl
- // deep copy objects
- const deepCopy = JSON.parse(JSON.stringify(obj));
- /* Gotchas
- X If the object has undefined values that will be stripped off
- and will not show up in the copied object, that is how JSON works.
- > This cannot copy function definitions present in an object.
- X/
Advertisement
Add Comment
Please, Sign In to add comment