Last active
October 22, 2015 05:16
-
-
Save daiiz/623827a61d1316bbaaa9 to your computer and use it in GitHub Desktop.
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 fb = function (n) { | |
for (var i = 1; i < n; i++) { | |
if (i % 15 === 0 ) { | |
console.log("FizzBuzz"); | |
}else if (i % 5 === 0) { | |
console.log("Buzz"); | |
}else if (i % 3 === 0) { | |
console.log("Fizz"); | |
}else { | |
console.log(i); | |
} | |
} | |
} | |
fb(100); |
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> | |
<title>JavaScript</title> | |
</head> | |
<body> | |
<div id="stage"> | |
</div> | |
<script> | |
var stage = document.querySelector('#stage') | |
var console = { | |
log: function (val) { | |
stage.innerHTML += val.toString() + '<br>'; | |
} | |
} | |
</script> | |
<!-- srcに、JavaScriptファイル名を入れる --> | |
<script src="tamesi.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment