Assign vs Direct

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Direct
let obj = {};
obj.a = 1;
obj.b = 2;
obj.c = 3;
ready
Assign
let obj = {};
Object.assign(obj, {a: 1, b: 2, c: 3});
ready
JSON
let obj = {a: 1, b: 2, c: 3};
ready

Revisions

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