Spread vs Object assign

Benchmark created on


Setup

const a = {a:0, b: false, c:'c', d: new Date()}

Test runner

Ready to run.

Testing in
TestOps/sec
Spread
const b = {...a}
ready
Assign
const b = Object.assign({}, a)
ready

Revisions

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