JavaScript Quick Tip: Make Function Arguments Required With Default Parameters
Have you ever written code like this?
const myFunction = (argument) => {
if (argument == null) {
throw new Error('argument is a required argument');
}
}
Guarding against invalid arguments is perfectly fine. It's way better than failing at so...
deepdive.hashnode.dev2 min read