Object assign vs Object spread with existing source (v4)

Revision 4 of this benchmark created on


Setup

let a = { a: 1, b: 2, c: 3, d: 4, e: 5 };
let b = {
	f: "5", g: "4", h: "3", i: "2", m: "1"
};

Test runner

Ready to run.

Testing in
TestOps/sec
Object.assign
Object.assign({a: 1}, a, b);
ready
Spread operator
a = {a: 1, ...a,...b};
ready

Revisions

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