Erforderliche Parameter für Funktionen in JavaScript
Oh, das ist clever! Ich habe das aus Davids Blog übernommen.
const isRequired = () => { throw new Error('param is required'); };
const hello = (name = isRequired()) => { console.log(`hello ${name}`) };
// These will throw errors
hello();
…