I am trying to create 40 cells with react , each should have a different title. For example a0 ...a9, b0 ..b9 etc. This is my code
const mapItems = () => {
let playerId = ["a", "b", "c", "d"];
let cellId;
let l, j;
for (j = 0; j < 4; j++) {
for (l = 0; l < 10; l++) {
cellId = playerId[j].concat(l);
return (
<Cell title={cellId} className={"column"}>
{returnItemsForCell(cellId)}
</Cell>
)
}
}
}
For some reason I get an error that a variable is not initialized , and only one in nested For loop.
Any ideas on how to do it right? Thanks in advance