Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 595 Bytes

File metadata and controls

18 lines (11 loc) · 595 Bytes

FizzBuzz

Instructions

Given positive integer n implement a function which returns a list numbers from 1 to n. However for multiples of three list should contain word Fizz instead of the number and for the multiples of five list should contain word Buzz. For numbers which are multiples of both three and five list should contain FizzBuzz word.

challenge | solution

Examples

fizzBuzz(5) // [1, 2, "Fizz", 4, "Buzz"]

fizzBuzz(16) // [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16]