The objetive as simple as writing a function that recives an integer n
and return an array from 1
to n
where:
- Multiples of 3 have been replaced with
Fizz
- Multiples of 5 have been replaced with
Buzz
- Multiples of both have been replaced with
FizzBuzz
fizzBuzzToN(0) // => []
fizzBuzzToN(5) // => [1,2,'Fizz', 4, 'Buzz']
fizzBuzzToN(15) // => [1,2,'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz']