2 ms·
The original commenter was creating the object at log-time, though, which means it wouldn't be shared by anything else. Unless x or y is an object, but in that
by brundolf 6y ago
The original commenter was creating the object at log-time, though, which means it wouldn't be shared by anything else. Unless x or y is an object, but in that case the issue is completely tangential to the original suggestion
And anyway- JSON.parse(JSON.stringify(x)) would be preferable because you'd still get the browser's rich object exploration
- da39a3ee 6y ago> Unless x or y is an object, but in that case the issue is completely tangential to the original suggestion Of course we have to assume that x and y may be objects!