Exercise: Fizz Buzz

In the game "fizz buzz", you count from 1 to a given number. Here are the rules:

Your program should count from 1 to 30 and follow the rules above:
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizz buzz
16
17
fizz
19
buzz
fizz
22
23
fizz
buzz
26
fizz
28
29
fizz buzz

Hint 💡

You can check if a number is evenly divisible by another number using the remainder operator %. For example, number % 4 == 0 checks if number divided by 4 has remainder 0 and is thus evenly divisible.

Hint 💡

To check if two boolean expression are both true, you can use the && operator (called logical AND). For example:
if (number % 9 == 0 && number > 18) {
  // Do something
}