Capstone: FizzBuzz
Time to combine conditionals with the modulo operator. FizzBuzz is a programming rite of passage.
Your task
Write fizzbuzz(n) that returns:
"FizzBuzz"ifnis divisible by both 3 and 5"Fizz"if divisible by 3"Buzz"if divisible by 5- otherwise the number
nitself
Order matters β check the "both" case first!
β‘ 40 XP
π§± Code blocks
Drag a block into the editor, or tap it to drop it in where your cursor is. Add them in order to build your answer.
solution.jsRuns in your browser
Loading editorβ¦
Tests4 to pass
3 β Fizz
5 β Buzz
15 β FizzBuzz
1 β 1
Run your code to check these.