Forked from Ankitashah212/gist:6e76584a77f1db9c2d269a111eddf477
Last active
August 29, 2017 17:23
-
-
Save bobbravo2/1df6c19b2799c34901dae73b9a47e3b5 to your computer and use it in GitHub Desktop.
fizzbuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=<device-width>, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
for (var i = 1; i < 101; i++) { | |
var print = ""; | |
if (i % 3 == 0) { | |
print += "fizz"; | |
} | |
if (i % 5 == 0) { | |
print += "Buzz"; | |
} | |
if (print.length > 3) { | |
console.log(print + " "); | |
} | |
else { | |
console.log(i); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment