JSFiddle - React, Tailwind, and code Playground
JavaScript
var start = new Date();
var g = {};
g.world = { h:2000, w:4000, cellInfo: [] };
var i, j,
world = g.world,
hlim = world.h,
wlim = world.w,
cellInfo = world.cellInfo,
the4k = [];
for (j = wlim; j; j--) {
the4k[j] = 1;
}
cellInfo[hlim] = the4k;
for ( i = hlim - 1; i; i--) {
cellInfo[i] = the4k.slice(0);
}
g.world.cellInfo = cellInfo;
alert(new Date() - start);