Skip to content

Question

  • Write a program that console logs the numbers from 1 to n. But for multiples of 3 print “fizz” instead of the number and for the multiples of 5 print “buzz”. For numbers which are multiples of both 3 and 5 print “fizzbuzz”.
  • Example
  • fizzBuzz(5): [1, 2, fizz, 4, buzz]