Created
March 31, 2017 22:01
-
-
Save yomete/6505ce4fa7281e5db8828fa7cb52da13 to your computer and use it in GitHub Desktop.
FizzBuzz JavaScript solution
This file contains 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
let num = 0 | |
for (let counter = 0; counter < 100; counter++ ) { | |
num += 1 | |
if ( num % 3 == 0 && num & 5 == 0) { | |
console.log ("FizzBuzz") | |
} | |
else if ( num % 3 == 0) { | |
console.log ("Fizz") | |
} | |
else if ( num % 5 == 0) { | |
console.log ("Buzz") | |
} | |
else { | |
console.log (num) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment