Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DON'T
- const myCopy = JSON.parse(JSON.stringify(myObject));
- // DO
- import {structuredClone} from "@ungap/structured-clone";
- const myCopy = structuredClone(myObject);
- // DO
- import {cloneDeep} from "lodash";
- const myCopy = cloneDeep(myObject);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement