This is my code thus far for a getCoordinates function that produces a list of coordinates in a grid.
getCoordinates = () => {
let result = []
for (int i = 1; i <= this.state.gridSize; i++){
for (int j = 1; j <= this.state.gridSize; j++){
result.push([i*100, j*100])
}
}
return result;
};
I want to return something like for gridSize = 4
[[100, 100], [100, 200], [100, 300], [100, 400],
[200, 100], [200, 200], [200, 300], [200, 400],
[300, 100], [300, 200], [300, 300], [300, 400],
[400, 100], [400, 200], [400, 300], [400, 400]]
Can anyone please help me get the correct syntax?