Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let ret = {};
let src = {
a: {
b: 1
}
};
ret = JSON.parse(JSON.stringify(src));
src.a.b = 'test';
console.log(ret); // { a: { b: 1 } }
console.log(src); // { a: { b: 'test' } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment