1 size = 10;
2
3 grid = ""
4
5 for (var i = 1; i <= size; i++) {
6 for (var j = 1; j <= size; j++) {
7 if (i % 2 === 0) {
8 grid+= "# "
9 } else {
10 grid+= " #"
11 }
12 }
13 grid+= "\n"
14 }
15
16
17 console.log(grid)