Skip to content

Instantly share code, notes, and snippets.

@AlejandroPerezMartin
Forked from kepta/def_par_9.js
Created November 21, 2017 12:22
Show Gist options
  • Save AlejandroPerezMartin/bf0ed6deaa37c188830e7658b137eac9 to your computer and use it in GitHub Desktop.
Save AlejandroPerezMartin/bf0ed6deaa37c188830e7658b137eac9 to your computer and use it in GitHub Desktop.
const isRequired = () => { throw new Error('param is required'); };
function filterEvil(array, evil = isRequired()) {
return array.filter(item => item !== evil);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment