Created
September 21, 2016 05:11
-
-
Save anonymous/9ea556fd094474ce3933cdf49e60004f to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/gedaro
This file contains 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 charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var result; | |
var max; | |
/* | |
for (var x = 1; i <= max; x += 1) { | |
if (x%3 === 0 && x%5 === 0) { | |
result = "fizzbuzz"; | |
} else if (i%3 === 0) { | |
result = "fizz"; | |
} else if (i%5 === 0) { | |
result = "buzz"; | |
} else { | |
result = i | |
} | |
console.log(result); | |
} | |
when I run this in the console it returns "i is not defined". | |
If I define "i" it returns "max is not defined". | |
If I define both it crashes the page. | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var result; | |
var max; | |
/* | |
for (var x = 1; i <= max; x += 1) { | |
if (x%3 === 0 && x%5 === 0) { | |
result = "fizzbuzz"; | |
} else if (i%3 === 0) { | |
result = "fizz"; | |
} else if (i%5 === 0) { | |
result = "buzz"; | |
} else { | |
result = i | |
} | |
console.log(result); | |
} | |
when I run this in the console it returns "i is not defined". | |
If I define "i" it returns "max is not defined". | |
If I define both it crashes the page.</script></body> | |
</html> |
This file contains 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
var result; | |
var max; | |
/* | |
for (var x = 1; i <= max; x += 1) { | |
if (x%3 === 0 && x%5 === 0) { | |
result = "fizzbuzz"; | |
} else if (i%3 === 0) { | |
result = "fizz"; | |
} else if (i%5 === 0) { | |
result = "buzz"; | |
} else { | |
result = i | |
} | |
console.log(result); | |
} | |
when I run this in the console it returns "i is not defined". | |
If I define "i" it returns "max is not defined". | |
If I define both it crashes the page. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment