Essential JavaScript

Going Further

FizzBuzz Kata

FizzBuzz is an old kata. You can Google it. It has history. It also has it's own Wikipedia article.

This particular kata actually started out as a children's game to learn division. It evolved into a coding challenge used in job interviews to screen programmers.

The challenge goes like this:

Write a program that prints the numbers from 1 to 100, but for multiples of three print "Fizz" instead of the number and for multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

You will need to write a function that accepts a number (from 1 to 100).

  • By default, return that number as the result.
  • However, if the number is divisible by 3, return "Fizz" instead.
  • If the number is divisible by 5, return "Buzz" instead.
  • For numbers divisible by both 3 and 5, return "FizzBuzz".

Code Editor

Click "Run Tests" to execute your function and see the test results below.

Test Results

Run your code to see test results

Console Output

// Console output will appear here...

0 output lines