Skip to content

Instantly share code, notes, and snippets.

@suzdalnitski

suzdalnitski/js-tricks-req.js Secret

Created Jul 22, 2019
Embed
What would you like to do?
const req = name => {
throw new Error(`The value ${name} is required.`);
};
const doStuff = ( stuff = req('stuff') ) => {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment