Last active
August 29, 2015 14:14
-
-
Save BlueInkAlchemist/8c77477f379c027c1515 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
<h1>The results of the function are:</h1> | |
<p id="fill"></p> |
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 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