zerofill 2d array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
for+for
var matrix = [];

for (var j = 0; j < 114; j++) {
        var row = [];

        for (var k = 0; k < 164; k++) {
                row.push(0);
        }

        matrix.push(row);
}
ready
for+apply
var matrix = [];

for (var j = 0; j < 114; j++) {
        matrix.push(Array.apply(null, new Array(164)).map(Number.prototype.valueOf,0));
}
ready

Revisions

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