proposal-Declarations-in-Conditionals icon indicating copy to clipboard operation
proposal-Declarations-in-Conditionals copied to clipboard

Results 8 proposal-Declarations-in-Conditionals issues
Sort by recently updated
recently updated
newest added

Moving from #2. Consider ```js if (const a = Math.random() < .5) { console.log(a); // definitely works console.log(b); // definitely throws } else if (const b = Math.random() < .5)...

> destructuring is not allowed (even if only a single variable is "pulled out"), as there's potential confusion as to what's actually being checked (the value vs. whether the desired...

Instead of declarations in conditionals, we could introduce `where` clause. The examples in README could be rewritten from: ```js // original example let foo = new Foo; if (let data...

It would be more useful if all initialized values ​​were automatically tested against `null` and` undefined`, failing the test if any value does not pass the test. Any other value...

I'm not sure if this will be inside the scope of this proposal, but I found it pretty useful to reduce nested if statements in the past. ```javascript // current...

I'm confused why the readme suggests that this would transpile to an IIFE instead of just a block. That is, why isn't it ```js class Foo { get data() {...

When declaring a variable with an initialiser, the completion value in evaluation is unmodified. However, assigning to a variable that has already been declared does modify the completion value. This...

Declarations could be useful in many other places, for example ```js foo(let bar = buz()); ``` Why not just equate variable declarations to expression statements in the scope of this...