Search⌘ K
AI Features

Fizzbuzz: Test your Flow control skills in Javascript

Explore how to apply conditional branching and flow control in JavaScript through the classic Fizzbuzz exercise. Learn to use logical operators and manipulate arrays and strings to improve your coding skills.

We'll cover the following...

Test 1: Conditionally branch your code

Javascript (babel-node)
fizzBuzz = function(num) {
// write a function that receives a number as its argument;
// if the number is divisible by 3, the function should return 'fizz';
// if the number is divisible by 5, the function should return 'buzz';
// if the number is divisible by 3 and 5, the function should return
// 'fizzbuzz';
//
// otherwise the function should return the number, or false if no number
// was provided or the value provided is not a number
}