Skip to content

Instantly share code, notes, and snippets.

@kencrocken
Created October 23, 2015 20:59
Show Gist options
  • Save kencrocken/3ea5472c34841350c6b1 to your computer and use it in GitHub Desktop.
Save kencrocken/3ea5472c34841350c6b1 to your computer and use it in GitHub Desktop.
function fizzBuzz(num) {
return (num % 3 * num % 5 == 0) ? (num % 3 == 0 ? "fizz" : "") + (num % 5 == 0 ? "buzz" : "") : num;
}
for(i = 1; i < 101; i++){
var y = fizzBuzz(i);
$("#result").append('<p>'+y+'</p>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment