let string1 = '# # # #';
let string2 = ' # # # #';
for (let i = 0; i < 8; i++) {
if(i%2) console.log(string2)
else console.log(string1)
}
let board = '';
let size = 8;
for (let i = 0; i < size; i++) {
for (let j = 0; j < size; j++) {
if ((i + j) % 2 === 0) {
board += ' ';
} else {
board += '#';
}
}
board += '\n';
}
console.log(board);