I am attempting to create an 8 x 8 grid. It's coming together, but the issue is that the first line only starts with one # sign.
function print(msg) {
console.log(msg);
return msg;
}
let result = "";
for(let i=1; i<=8; i++) {
result += " #\n"
for(let j=1; j<8; j++) {
result += " #";
}
}
print(result);
// output is
#
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # #
I am trying to build 8 x 8 grid its working but the problem is first line start from only one # sign