Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jaitjacob/c2a437484daea1ecf529b65b3344fbe3 to your computer and use it in GitHub Desktop.

Select an option

Save jaitjacob/c2a437484daea1ecf529b65b3344fbe3 to your computer and use it in GitHub Desktop.
Eloquent Javascript - Chaper 2 - Excercise 2.2 - FizzBuzz - Solution
let counter = 1;
while(counter<=100){
if(counter%3===0 && counter%5===0) console.log("FizzBuzz");
if(counter%3===0) console.log("Fizz");
if(counter%5===0) console.log("Buzz");
console.log(counter);
counter++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment