📅  最后修改于: 2022-03-11 15:03:26.344000             🧑  作者: Mango
const m = 4;
const n = 5;
let arr = new Array(m); // create an empty array of length n
for (var i = 0; i < m; i++) {
arr[i] = new Array(n); // make each element an array
}
console.log(arr); // Output: [ [ <5 empty items> ], [ <5 empty items> ], [ <5 empty items> ], [ <5 empty items> ] ]