Skip to content

Instantly share code, notes, and snippets.

@BlueInkAlchemist
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlueInkAlchemist/8c77477f379c027c1515 to your computer and use it in GitHub Desktop.
Save BlueInkAlchemist/8c77477f379c027c1515 to your computer and use it in GitHub Desktop.
<h1>The results of the function are:</h1>
<p id="fill"></p>
var theDiv = document.getElementById("fill");
function countUp() {
var i = 0;
var result = "";
for (i = 1; i < 100; i++) {
if (i % 5 === 0) {
if (i % 3 === 0) {
result = "threefive";
} else {
result = "five";
}
} else if (i % 3 === 0) {
result = "three";
} else {
result = i.toString();
}
theDiv.innerHTML += result;
theDiv.innerHTML += "<br/>";
}
}
countUp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment