Run details:
Mozilla/5.0 (Linux; Android 9; SM-G955U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Mobile Safari/537.36
Chrome Mobile 80
Android
Mobile
5 years ago
Test name Executions per second
JSON.parse 161176.2 Ops/sec
Object.assign 948776.0 Ops/sec
Script Preparation code:
AخA
 
var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
Tests:
  • JSON.parse

     
    var obj2 = JSON.parse(JSON.stringify(obj));
  • Object.assign

     
    var obj2 = Object.assign({}, obj);