Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // my journey with fizzbuzz
- // 1st attempt
- for (let i = 1; i <= 100; i+=1) {
- let output = '';
- if (Number.isInteger(i / 3)) {
- output += 'Fizz';
- }
- if (Number.isInteger(i / 5)) {
- output += 'Buzz';
- }
- if (output === '') {
- output += i;
- }
- console.log(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement