Skip to content

Instantly share code, notes, and snippets.

@mindplace
Created March 22, 2016 14:47
Show Gist options
  • Select an option

  • Save mindplace/d05b280f97286e327f8c to your computer and use it in GitHub Desktop.

Select an option

Save mindplace/d05b280f97286e327f8c to your computer and use it in GitHub Desktop.
function fizzBuzz(max) {
for (var num=1; num <= max; num++) {
var current = "";
if (num % 3 == 0) {
current += "Fizz";
}
if (num % 5 == 0) {
current += "Buzz";
}
if (!(current)) {
current += num.toString();
}
console.log(current);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment