Horje
creating 2d array in javascript Code Example
js array two dimensional
// declaration of a two-dimensional array
// 5 is the number of rows and 4 is the number of columns.
const matrix = new Array(5).fill(0).map(() => new Array(4).fill(0));

console.log(matrix[0][0]); // 0
creating 2d array in javascript
var [r, c] = [5, 5]; 
var m = Array(r).fill().map(()=>Array(c).fill(0));
2d array in javascript
function createArray(row,column) {
let arr = [];

for(var i=0; i<row; i++){
    arr[i] = [Math.floor(Math.random() * (10))];

    for(var j=0;j<column;j++){
        arr[i][j]= [Math.floor(Math.random() * (20))];
    }
}

return arr;
}

var arrVal = createArray(4, 5);

console.log(arrVal);




Javascript

Related
sequelize raw query Code Example sequelize raw query Code Example
cra proxy Code Example cra proxy Code Example
javascript swap variables Code Example javascript swap variables Code Example
splash screen react native Code Example splash screen react native Code Example
merge 2 dictionaries with same keys javascript Code Example merge 2 dictionaries with same keys javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7