Skip to content

Instantly share code, notes, and snippets.

@wiafe
Last active August 29, 2015 14:25
Show Gist options
  • Save wiafe/8a95c49cc77e56b918d5 to your computer and use it in GitHub Desktop.
Save wiafe/8a95c49cc77e56b918d5 to your computer and use it in GitHub Desktop.
My FizzBuzz javascript solution.
for (var i = 1; i <= 100; i++) {
if (i % 3 === 0) {
console.log( i + " = " + "Fizz");
}else if (i % 5 === 0) {
console.log( i + " = " + "Buzz");
}else {
console.log(i);
}
if (i % 3 === 0 && i % 5 === 0) {
console.log( i + " = " + "FizzBuzz");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment