for (let i = 0; i < 101; i++) { if (i % 3 != 0 && i % 5 != 0) { document.write(i, ","); } if (i > 0 && i % 3 == 0 && i % 5 != 0) { document.write("Fizz", " ,"); } if (i > 0 && i % 5 == 0 && i % 3 != 0) { document.write("Buzz", ","); } if (i > 0 && i % 3 == 0 && i % 5 == 0) { document.write("FizzBuzz", ","); } }
FIZZBUZZ IN JS
Updated: Aug 28, 2022
Comentários