Created
May 3, 2018 18:48
-
-
Save raspher/430d3d38a40a8bdaa5356d99e671a12f to your computer and use it in GitHub Desktop.
JS Bin ZJS 2.2 - FizzBuzz // source https://jsbin.com/yunemis
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> | |
<head> | |
<meta name="description" content="ZJS 2.2 - FizzBuzz"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
for (var x=1;x<=100;x++){ | |
switch (true){ | |
case (x % 5 === 0 && x % 3 === 0): | |
console.log("FizzBuzz"); | |
break; | |
case (x % 3 === 0): | |
console.log("Fizz"); | |
break; | |
case (x % 5 === 0): | |
console.log("Buzz"); | |
break; | |
default: | |
console.log(x); | |
} | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">for (var x=1;x<=100;x++){ | |
switch (true){ | |
case (x % 5 === 0 && x % 3 === 0): | |
console.log("FizzBuzz"); | |
break; | |
case (x % 3 === 0): | |
console.log("Fizz"); | |
break; | |
case (x % 5 === 0): | |
console.log("Buzz"); | |
break; | |
default: | |
console.log(x); | |
} | |
}</script></body> | |
</html> |
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
for (var x=1;x<=100;x++){ | |
switch (true){ | |
case (x % 5 === 0 && x % 3 === 0): | |
console.log("FizzBuzz"); | |
break; | |
case (x % 3 === 0): | |
console.log("Fizz"); | |
break; | |
case (x % 5 === 0): | |
console.log("Buzz"); | |
break; | |
default: | |
console.log(x); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment