function createNewMatrix(row, column) { var arr = Array(row).fill().map(() => Array(column).fill(0)); return arr; } console.log(createNewMatrix(3, 3));