Fizz Buzz

Write a script that displays the numbers from 1 to 100 in the console (both included and with a line break between each print), substituting the following:

  • Multiples of 3 for the word fizz.
  • Multiples of 5 for the word buzz.
  • Multiples of 3 and 5 at the same time for the word fizzbuzz.
solution.js
1for (let i = 1; i < 101; i++) {
2 if (i % 3 === 0 && i % 5 === 0) {
3 console.log("fizzbuzz");
4 } else if (i % 3 === 0) {
5 console.log("fizz");
6 } else if (i % 5 === 0) {
7 console.log("buzz");
8 } else {
9 console.log(i);
10 }
11}