Enforce required parameters
05/07/2018 — 1 Min Read — In JavaScript, ES6
const throwIfMissing = () => {
throw new Error('You have missing param!');
};
const func = (requiredParam = throwIfMissing()) => {
// your code here
};
PreviousHide empty HTML Element
NextcurrentColor