JSFiddle - React, Tailwind, and code Playground

by farrukhsubhani

HTML

<input id="ct" value="3" />

JavaScript

yourarray=[];
var start2darray = new Date().getMilliseconds();
for (i = 0; i <4; i++) {
     temparray=[];
    for (j = 0; j < 5; j++) {
        temparray.push($('#ct').val()) //your values here
    }
yourarray.push(temparray);
}
var stop2darray = new Date().getMilliseconds();
console.log(yourarray);
console.log("Time:"+ (stop2darray - start2darray));
//with custome names

yourarray=[];
var starteval = new Date().getMilliseconds();
for (i = 0; i <4; i++) {
    eval("temparray"+i+"=[]");
    for (j = 0; j < 5; j++) {
        eval("temparray"+i+".push($('#ct').val())"); //your values here
    }
yourarray.push(eval("temparray"));
}
var stopeval = new Date().getMilliseconds();
console.log(yourarray);
console.log("Time:"+ (stopeval - starteval));