Mikemike8 / javabuzz

.
0 stars 0 forks source link

FIZZBUZZ Output #1

Open mrjones91 opened 3 weeks ago

mrjones91 commented 3 weeks ago

I'm not seeing any fizzbuzz output and it would be nice to not have empty output lines

Mikemike8 commented 3 weeks ago

for (let i = 0; i < 31; i++) { const item = i; let fizz; let buzz;

if (item % 3 === 0) {
    fizz = "fizz";
}
if (item % 5 === 0) {
    buzz = "buzz";
}

console.log(fizz + buzz || item);

}