DML School of Technology
Menu

Getting going, Decisions

FizzBuzz

The task

Return "Fizz" if the number divides by 3, "Buzz" if it divides by 5, "FizzBuzz" if it divides by both, and otherwise the number itself as text.

Write a function called fizzBuzz.

Tests

CallExpectedYours
fizzBuzz(3) "Fizz" not run
fizzBuzz(5) "Buzz" not run
fizzBuzz(15) "FizzBuzz" not run
fizzBuzz(7) "7" not run
fizzBuzz(30) "FizzBuzz" not run
fizzBuzz(1) "1" not run

Next challenge · All challenges

solution.js

Tab indents. To leave the editor, press Escape, then Tab.

Output

Run prints what your code prints. Run the tests to check your function.