fizzbuzz.js
for (let i = 1; i <= 100; i++) {
let output = '';
if (i % 3 === 0) output += 'Fizz';
if (i % 5 === 0) output += 'Buzz';
console.log(output || i);
}
Go to list of users who liked
for (let i = 1; i <= 100; i++) {
let output = '';
if (i % 3 === 0) output += 'Fizz';
if (i % 5 === 0) output += 'Buzz';
console.log(output || i);
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked