A Pen by Tyler Peterson on CodePen.
Created
September 27, 2018 15:42
-
-
Save tylerpeterson/b68b12ba846f59f6d6c43bf143de963b to your computer and use it in GitHub Desktop.
2017-06-15-08-47-11 sample
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
<!-- a bunch of markup --> | |
<!-- a bunch of markup --> | |
<p>The count is <span id="result">blah</span></p> | |
<!-- a bunch of markup --> | |
<!-- a bunch of markup --> | |
<!-- a bunch of markup --> | |
<!-- a bunch of markup --> | |
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
function countItems(arr) { | |
var i; | |
var count = 0; | |
for (i = 0; i < arr.length; ++i) { | |
if (arr[i] % 3 === 0) { | |
count++; | |
} | |
} | |
return count; | |
} | |
// Glue Code | |
document.getElementById('result').innerHTML = countItems([3]); | |
// fin. |
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
#result { | |
color: red; | |
font-weight: bold; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment