Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Created May 1, 2019 16:27
Show Gist options
  • Select an option

  • Save jlittlejohn/e6a11383c83ec0a4a339ca918256de73 to your computer and use it in GitHub Desktop.

Select an option

Save jlittlejohn/e6a11383c83ec0a4a339ca918256de73 to your computer and use it in GitHub Desktop.
JS: For Loop Example
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