domenic at domenicdenicola.com (2014-02-04T21:24:21.533Z)
John Lenz wrote:
> Generally, I've always thought of:
>
> `if (x) ...` as equivalent to `if (x) { ... }`
let and const (and class) are block-scoped. {...} in your "if (x) {...}"
is a block. An unbraced consequent is not a block, and you can't have a
"conditional let binding".
The restriction avoids nonsense such as
```js
let x = 0; { if (y) let x = 42; alert(x); }
```
What pray tell is going on here, in your model?
John Lenz wrote: > Generally, I've always thought of: > > "if (x) ..." as equivalent to "if (x) { ... }" let and const (and class) are block-scoped. {...} in your "if (x) {...}" is a block. An unbraced consequent is not a block, and you can't have a "conditional let binding". The restriction avoids nonsense such as let x = 0; { if (y) let x = 42; alert(x); } What pray tell is going on here, in your model? /be