Hacker News new | ask | show | jobs
by earthboundkid 1894 days 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…

2 comments

I'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

So, impostor syndrome aside, why not? Wanna team up on that?

whoosh.gif
Okay, it was 2am here and I must have misread your comment and lost the 'variables' part.
It is already possible: var makes a variable function-scoped, let/const makes a variable block-scoped. Or are you referring to something else?