Created
May 1, 2019 16:27
-
-
Save jlittlejohn/e6a11383c83ec0a4a339ca918256de73 to your computer and use it in GitHub Desktop.
JS: For Loop Example
This file contains hidden or 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 anArray = [true, false, false, true, true, false]; | |
| var trueArray = []; | |
| var falseArray = []; | |
| for (i = 0; i < anArray.length; i++) { | |
| if (anArray[i] === true) { | |
| trueArray.push(anArray[i]); | |
| } else { | |
| falseArray.push(anArray[i]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment