The young campers are playing a game where they count from 1 to 100 one number at a time. For each number:
For instance, here's how a game might go:
1, 2, Fizz, 4, Buzz, 5, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17, Fizz ... 97, 98, Fizz, Buzz
Implement a program that simulates a game of FizzBuzz using JavaScript
The campers get bored easily, so they want to mix up the rules a bit. They might:
You don't want to make manual modifications to the code every time the rules change. How would you update your code to handle these conditions for future runs?
Hint: how could you utilize function parameters and/or an object literal to make this possible?