const generateMatrix = (row, column) => {
const matrixArr = [];
for (let i = 0; i < row; i++) {
matrixArr[i] = [];
for (let j = 0; j < column; j++) {
matrixArr[i][j] = generateNumbers(25, 100);
}
}
return matrixArr;
};
const createCard = matrix => {
const card = document.createElement('div');
card.className = 'card';
matrix.forEach(element => {
element.forEach(el => {
const cell = document.createElement('div');
cell.className = 'cell';
cell.textContent = el;
card.appendChild(cell);
});
});
cardContainer.appendChild(card);
};
map
вместо forEach
? array(0) { }