FizzBuzz is a famous programming challenge meant to test your approach to a simple problem. Today we'll be doing a very simple version of that simple problem. No loops (yet), but single-number FizzBuzz is an excellent test of our branching logic abilities! What's more, there are many different approaches to this problem--what path will you take?
You'll get practice with the following:
- Full-featured functions (parameters and return values).
if-else
statements.- Modulus operations.
You'll only write one function this time, but there are various inputs you'll need to handle, so this is a test-driven exercise.
- Fork, clone, and navigate to this repo.
- Run
npm install
andnpm test
. - Code away until the results are all green.