Exercise 1
Found a way to use only one while loop.
<html>
<script>
let counter = 0; // starts counter at 0
let garabato=" "; // creates an empty string
while (counter < 7) {
counter = counter + 1;
garabato=garabato+"#";
console.log(garabato);
}
</script>
</html>
Exercise 2, second part
<html>
<script>
let n= 0;
while(n<=100){
n=n+1;
if((0==n%3)&&(0==n%5)){
console.log("FizzBuzz");
}
else if ( (0==n%5)&&(!(0==n%3)) ) {
console.log("Buzz")
}
else if (!(0==n%5)&&((0==n%3)) ) {
console.log("Fizz")
}
else {
console.log(n)
}
}
</script>
</html>
Exercise 3, the second part, where you specified size
<html>
<script>
// first parts creates second the line of chessboard, according to given size
let mySize=10; // set the size of chess board
let chunk= "#"+" ";
let n=1; // counter to create line at even position
let myEvenLine=" ";
while(n <= mySize){
myEvenLine=myEvenLine+chunk; // final state of myLine gives lines at even position
n=n+1;
}
// second part creates chessboard
let counter = 0; // start a counter of even or odd lines
while (counter <= mySize) {
counter = counter + 1;
if(1==counter%2){
myOddLine=" "+myEvenLine;
console.log(myOddLine);
}
else {
console.log(myEvenLine);
}
}
</script>
</html>