working through the tutorial. I wrote a piece of code to return all numbers in range and replace those %3 && 5% or both with a string, but for whatever reason codeacademy returns an error (Oops, try again. It looks like you printed out the wrong number of items).
Here is my code, hopefully you can enlighten me where the problem is:
function fizzBuzz(num){
var i = 1;
while(i <= num){
if (i % 3 === 0 && i % 5 === 0) {
console.log("FizzBuzz");
i++;
} else if (i % 3 === 0) {
console.log("Fizz");
i++;
} else if (i % 5 === 0) {
console.log("Buzz");
i++;
} else {
console.log(i);
i++;
}
}
}
console.log(fizzBuzz(20));