Skip to content

Instantly share code, notes, and snippets.

@angvishvish
Forked from jaysonrowe/FizzBuzz.js
Last active August 29, 2015 14:15
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 angvishvish/2231ffe650a66ae185a4 to your computer and use it in GitHub Desktop.
Save angvishvish/2231ffe650a66ae185a4 to your computer and use it in GitHub Desktop.
var check = function (number) {
var fizz = number % 3 == 0,
buzz = number % 5 == 0;
console.log(fizz ? buzz ? "FizzBuzz" : "Fizz" : buzz ? "Buzz" : number);
if (number != 0) {
return check(number - 1);
}
}
check(100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment