Skip to content

Instantly share code, notes, and snippets.

@kepta
Created November 19, 2017 10:28
Show Gist options
  • Save kepta/78bd7e0d9a3e2c7e1f31086dc9830945 to your computer and use it in GitHub Desktop.
Save kepta/78bd7e0d9a3e2c7e1f31086dc9830945 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