Last active
August 29, 2015 14:21
-
-
Save marcusellis05/0393db956e9401f53844 to your computer and use it in GitHub Desktop.
FizzBuzz
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
function fizzbuzz(limit){ | |
var fb; | |
for (var i=1; i<=limit; i++){ | |
fb = ''; | |
if (i % 3 === 0){ | |
fb += 'Fizz'; | |
} | |
if (i % 5 === 0){ | |
fb += 'Buzz'; | |
} | |
if (!fb){ | |
fb = i; | |
} | |
console.log(fb); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment