Refutable destructuring

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Aug 9 16:03:37 PDT 2013


On Aug 9, 2013, at 2:58 PM, Domenic Denicola wrote:

> Woah. I was sad about the loss of refutable destructuring, i.e. I would rather have had it by default, but this idea is a pretty brilliant way to make lemonade out of lemons. I would *love* a way to declaratively specify required parameters.


const MUST = () => {throw TypeError("Missing required parameter"};

function foo (a=MUST(), b, c) {...}

Allen


More information about the es-discuss mailing list