Skip to content

Instantly share code, notes, and snippets.

@harryadel
Last active August 26, 2016 19:11
Show Gist options
  • Save harryadel/60e0d43a71f0b4b2df4a83d28f4a44f6 to your computer and use it in GitHub Desktop.
Save harryadel/60e0d43a71f0b4b2df4a83d28f4a44f6 to your computer and use it in GitHub Desktop.
/*
My answer for exercise 'FizzBuzz'
in Eloquent JavaScript Second Edition
Chapter 2 Program Structure
*/
for (var i = 1;i < 101;i++) {
var output = " ";
if (i % 3 == 0) {
output += "Fizz";
}
if (i % 5 == 0) {
output += "Buzz";
}
console.log(i + output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment