Skip to content

Instantly share code, notes, and snippets.

@shaunwallace
Created November 19, 2014 14:04
Show Gist options
  • Save shaunwallace/f79dde0fd548925af6f0 to your computer and use it in GitHub Desktop.
Save shaunwallace/f79dde0fd548925af6f0 to your computer and use it in GitHub Desktop.
Array.prototype.filter()
function isBigEnough(element, index, array) {
return element >= 10;
}
[12, 5, 8, 130, 44].filter(isBigEnough); // returns [12,130,44]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment