I'm trying to fill create an array of JSX objects using a 2d array to represent a game board:
const rows = [];
for (var i=0; i<8; i++) {
rows.push(<div className="board-row">);
for (var y=0; y<8; y++) {
rows.push(this.renderSquare(y, i));
}
rows.push(</div>);
}
However, I keep getting an error:
Syntax error: Unexpected token
on the line: for (var y=0; y<8; y++) {
pointing at the 8
.
Can anybody help me understand what I'm doing wrong?