Skip to content

Instantly share code, notes, and snippets.

@polamjag
Created October 10, 2011 11:04
Show Gist options
  • Save polamjag/1275056 to your computer and use it in GitHub Desktop.
Save polamjag/1275056 to your computer and use it in GitHub Desktop.
FizzBuzz on js
<html>
<body>
<script type="text/javascript">
for (i=1; i<=100; i++) {
if (i%15 === 0) {
t = "Fizz Buzz";
} else if (i%3 === 0) {
t = "Buzz";
} else if (i%5 === 0) {
t = "Fizz";
} else {
t = i;
}
document.write(t+"<br>");
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment