Skip to content

Instantly share code, notes, and snippets.

@caitfriedlander
Forked from anonymous/index.html
Created September 21, 2016 05:11
Show Gist options
  • Save caitfriedlander/79c196b628cef019546b61c853f7ed88 to your computer and use it in GitHub Desktop.
Save caitfriedlander/79c196b628cef019546b61c853f7ed88 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/gedaro
<!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>
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