FizzBuzz

Easy · javascript · javascript · fundamentals

Write solution(n) that returns an array of strings from 1 to n: "Fizz" for multiples of 3, "Buzz" for multiples of 5, "FizzBuzz" for both, otherwise the number as a string.

Sample tests

solution(5) // => ["1","2","Fizz","4","Buzz"]

Submit

Leaderboard