Skip to content

Instantly share code, notes, and snippets.

@waqarNaeem786
Last active May 12, 2024 09:13
Show Gist options
  • Save waqarNaeem786/56e9d7afe79078c361e01307df94a793 to your computer and use it in GitHub Desktop.
Save waqarNaeem786/56e9d7afe79078c361e01307df94a793 to your computer and use it in GitHub Desktop.
Simple FizzBuzz in JS
for (var counter = 1; counter <= 100; counter++) {
var output = "";
if (counter % 3 == 0)
output += "Fizz";
if (counter % 5 == 0)
output += "Buzz";
console.log(output || counter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment