I tried to make this exercise in different appoaches.
here I used a function. I know It’s not optimal in this exercise, but great for learning.
//fizzbuzz
function check(value) {
if (value % 3 === 0 && value % 5 === 0){
return('Fizzbuzz');
} else if (value % 3 === 0){
return('fizz');
} else if (value % 5 === 0){
return('buzz');
} else return(value);
}
// Loop
for (var count =0;count<100;count++){
var x = check(count);
console.log(x);
}