Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created April 11, 2015 21:54
Show Gist options
  • Select an option

  • Save StoneCypher/b6c8e4aead8048538040 to your computer and use it in GitHub Desktop.

Select an option

Save StoneCypher/b6c8e4aead8048538040 to your computer and use it in GitHub Desktop.
// use map, but, this is how to do it without map
var result = [];
for (var r=0, rCount = totalRows.length; r<rCount; ++r) {
var thisRowIsExcluded = false;
for (var c=0, cCount = totalColumns.length; c<cCount; ++c) {
var filterCriterion = totalColumns.getYourInputThingSomehowHere;
if (yourFilterFailsOn(totalRows[r].whicheverColumn, filterCriterion)) {
thisRowIsExcluded = true;
}
}
if (!(thisRowIsExcluded)) {
result.push(totalRows[r]);
}
}
doReactShitWith(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment