Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
352 B
4
Indexable
Never
var output = [];
var count = 1;

function fizzBuzz() {


count++;


if (count%3 ===0 && count%5 === 0){
    output.push("FizzBuzz");
} else if (count%3 === 0 && count%5 !== 0){
    output.push("Fizz");
} else {
    if (count%5 === 0 && count%3 !==0){
        output.push("Buzz");
    }else {
        output.push(count);
    }
}

console.log(output);

}