spread vs assign

Benchmark created on


Description

Setup

const a = { "foo": "bar" }
const b = { "bar": "foo" }

Test runner

Ready to run.

Testing in
TestOps/sec
assign
const res = Object.assign(a, b);
ready
spread
const res ={...a, ...b};
ready

Revisions

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