Created
February 25, 2019 00:24
-
-
Save okovalov/c9298e57c4e5895f51f00bdb3bfa0ca0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fizzBuzz = num => { | |
for(let i = 1; i <= num; i++) { | |
if (i % 15 === 0) { | |
console.log('FizzBuzz') | |
continue | |
} | |
let val = i | |
if (i % 3 === 0) val = 'Fizz' | |
if (i % 5 === 0) val = 'Buzz' | |
console.log(val) | |
} | |
} | |
const result = fizzBuzz(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment