What is the best way to clone an object in node.js
e.g. I want to avoid the situation where:
var obj1 = {x: 5, y:5}; var obj2 = obj1; obj2.x = 6; con
npm install node-v8-clone
Fastest cloner, it open native clone method from node.js
var clone = require('node-v8-clone').clone; var newObj = clone(obj, true); //true - deep recursive clone