FizzBuzz

FizzBuzz code challenge
mail@pastecode.io avatar
unknown
javascript
2 years ago
307 B
1
Indexable
Never
var num = 1;
var output = [];
function fizzBuzz() {
    if ((num % 15) === 0)
        output.push("FizzBuzz");
    else if ((num % 3) === 0)
        output.push("Fizz");
    else if ((num % 5) === 0)
        output.push("Buzz");
    else
        output.push(num);
     
    console.log(output);
    num++;
}