Created
May 14, 2015 08:17
-
-
Save LarryAnomie/debebb45d74b23eee3a7 to your computer and use it in GitHub Desktop.
FizzBuzz JS
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
var i = 0; | |
for( i; i <= 100; i++) { | |
var buffer = ''; | |
if ( i % 3 === 0) { | |
buffer = 'fizz'; | |
if ( i % 5 === 0) { | |
buffer += ' buzz'; | |
} | |
} else if (i % 5 === 0) { | |
buffer = 'buzz'; | |
} else { | |
buffer = i; | |
} | |
console.log(buffer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment