Skip to content

Instantly share code, notes, and snippets.

@anaibol
Created August 20, 2017 11:37
Show Gist options
  • Save anaibol/8cd7290ea5db8e2489aed59c35853303 to your computer and use it in GitHub Desktop.
Save anaibol/8cd7290ea5db8e2489aed59c35853303 to your computer and use it in GitHub Desktop.
Minimal Array.find polyfill
if (!Array.prototype.find) {
Array.prototype.find = function (predicate) {
return this.filter(predicate)[0]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment