Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Arrays Intro
Making Arrays
Array Builder Kata
Array Elements
Human Names Kata
Array Length
Longest Array Kata
Looping Over Arrays
Highest Number Kata
Word Hunter Kata
Array Average Kata
Min-Max Kata
Adding Elements
Number Range Kata
Removing Elements
Arrays of Objects
Biggest Animal Kata
Arrays of Arrays
Taboo Words Kata
Going Further
Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Arrays Intro
Making Arrays
Array Builder Kata
Array Elements
Human Names Kata
Array Length
Longest Array Kata
Looping Over Arrays
Highest Number Kata
Word Hunter Kata
Array Average Kata
Min-Max Kata
Adding Elements
Number Range Kata
Removing Elements
Arrays of Objects
Biggest Animal Kata
Arrays of Arrays
Taboo Words Kata
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