Created
November 19, 2017 10:28
-
-
Save kepta/78bd7e0d9a3e2c7e1f31086dc9830945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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