You’re very welcome!
Great attempt at the Chessboard ! 
… and nice formatting 
Now think about how different statements nest within each other, and use the indentations for each further degree of nesting. This makes your program even clearer to other developers e.g.
var row_count = 1
var continue2 = true;
while(continue2){
row_count++;
if(row_count%2==0){
console.log(" # # # #");
}
else{
console.log("# # # # ");
}
if(row_count>8){
continue2 = false;
}
}
Can you see that it’s now clearer at first glance, what is nested within what? First, we have our variables and our which
statement. Within our which
statement we have our if...else
statements. Then within each if
or else
statement we have a third “level” of nesting.
Your code works fine with dimensions 8 x 8 (8 rows, 8 columns). However, let’s say you wanted to provide the flexibility to change those dimensions to say 10 x 10, or 5 x 5. With your version, each time you’d have to manually amend:
- the number of '#'s in your two
console.log()
statements; and
- the
row_count
limit in the following if
statement:
if(row_count>8){
continue2 = false;
}
Rather than have to make these manual adjustments each time, we ideally want the program to be able to handle this by a simple variable reassignment.
You could adapt your program to do this by declaring an additional variable at the beginning which stores the row limit, and then replace the fixed 8
with this new variable’s name in the if statement above.
The problem then becomes how to extend this functionality to the number of columns as well. Have a look at how the model answer deals with this. You will really learn loads by spending time at this “reflection stage”, and maybe trying to amend your version for this additional functionality. You may well find you can’t, and so you’ll learn a lot about how different approaches have different advantages and limitations, and their suitability in different situations (depending on what you want to achieve).
Keep on learning, you’re doing great! 