Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save achudars/5520271 to your computer and use it in GitHub Desktop.
Save achudars/5520271 to your computer and use it in GitHub Desktop.
Filtering out all small values using JavaScript Array filter method
function isBigEnough(element, index, array) {
return (element >= 10);
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered is [12, 130, 44]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment