Skip to content

Instantly share code, notes, and snippets.

@amaxwell01
Created August 6, 2013 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amaxwell01/6167912 to your computer and use it in GitHub Desktop.
Save amaxwell01/6167912 to your computer and use it in GitHub Desktop.
Fizzbuzz in JavaScript
var increment;
for ( increment = 0; increment < 100; increment++ ) {
if ( increment % 15 === 0 ) {
console.log( 'fizzbuzz' );
} else if ( increment % 3 === 0 ) {
console.log( 'fizz' );
} else if ( increment % 5 === 0 ) {
console.log( 'buzz' );
} else {
console.log( increment );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment