I am learning through an online course but the instructor computers seems to return the output as expected whereas my computer simply doesn’t return me anything. also tried using online compilers
I am trying to make a "FizzBuzz" program.
Thanks for help anyways
var output = [];
var count = 1 ;
function fizzBuzz() {
output.push(count);
count++;
console.log(output);
}
>Solution :
call fizzBuzz() at the end of the script 🙂
also keep in mind that after the execution you will have [ 1 ]
cause you’re pushing the value before incrementing
the code:
var output = [];
var count = 1 ;
function fizzBuzz() {
output.push(count);
count++;
console.log(output);
}
fizzBuzz()