Test name | Executions per second |
---|---|
JSON.parse | 965243.4 Ops/sec |
Object.assign | 4322022.0 Ops/sec |
var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
var obj2 = JSON.parse(JSON.stringify(obj));
var obj2 = Object.assign({}, obj);