3-ways-to-clone-object

Benchmark created by samanthaming on


Setup

const obj = {type:"Fiat", model:"500", color:"white"};

Test runner

Ready to run.

Testing in
TestOps/sec
Spread
{...obj}
ready
Object.assign
Object.assign({},obj)
ready
JSON
JSON.parse(JSON.stringify(obj))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by samanthaming on