Skip to content

Instantly share code, notes, and snippets.

@parwatcodes
Created April 16, 2019 15:57
Show Gist options
  • Save parwatcodes/b5c1cf7eb8b1eb94c909f72f77202467 to your computer and use it in GitHub Desktop.
Save parwatcodes/b5c1cf7eb8b1eb94c909f72f77202467 to your computer and use it in GitHub Desktop.
console.log([false, null, 2, 0, undefined].filter(Boolean));
const isRequired = () => { throw new Error('param is required'); };
const hello = (name = isRequired()) => { console.log(`hello ${name}`) };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment