Eloquent JavaScript Read-Along - Program Structure - Exercises - FizzBuzz

preview_player
Показать описание
Eloquent Javascript - Copyright © 2018 by Marijn Haverbeke

Рекомендации по теме
Комментарии
Автор

A couple years back when I was just learning code, I had to follow along with the example. This time around, I was able to solve this in a little time. This gives me great confidence that I have an understanding. I did it off the bat with a for if-else statement.

darklen
Автор

my code isnt running properly. it only counts to 100
let counter = 1;
while (counter <= 100) {
if ((counter % 3 === 0) && (counter % 5 === 0)){
console.log("FizzBuzz")
counter += 1;
continue;
}
if (counter % 3 === 0) {
console.log("Fizz");
counter += 1;
continue;
}
if (counter % 5 === 0) {
console.log("Buzz");
counter += 1;
continue;
}
console.log (counter);
counter += 1;
}

adrianschneider