Test name | Executions per second |
---|---|
Object literal | 2606.1 Ops/sec |
Constructor | 2587.7 Ops/sec |
const a = [];
let i = 0;
while (i < 10000) {
const d = {};
a.push({ b: i });
i++;
}
const a = [];
const c = function(i) {
this.b = i;
}
let i = 0;
while (i < 10000) {
a.push(new c(i));
i++;
}