3 ms·
> `finally` introduces additional blocks It would be cool if someone made a way to scope variables at the function level in JavaScript instead of at the block
by earthboundkid 6y ago
> `finally` introduces additional blocks
It would be cool if someone made a way to scope variables at the function level in JavaScript instead of at the block level. I might write a transpiler for it…
- golergka 6y agoI've never considered writing a proposal for a language feature before, but after 2 minutes of googling, this actually looks completely doable: https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md So, impostor syndrome aside, why not? Wanna team up on that?
- earthboundkid 6y agowhoosh.gif
- golergka 6y agoOkay, it was 2am here and I must have misread your comment and lost the 'variables' part.
- jakopo87 6y agoIt is already possible: var makes a variable function-scoped, let/const makes a variable block-scoped. Or are you referring to something else?