4 ms·
It does, but they aren't expressions like you're suggesting. They only thing they do is limit the scope of variable defined inside them (assuming let or const a
by nicoburns 5y ago
It does, but they aren't expressions like you're suggesting. They only thing they do is limit the scope of variable defined inside them (assuming let or const are used. var is not effected). There is a proposal for this under the name "do expressions" because the proposed syntax is like this:
foo: do {
const f = 1;
f
}
(because a plain block would be ambiguous with object literal syntax in some cases).
- eatonphil 5y agoSweet, thanks for the pointer.