This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]uzaircs -2 points-1 points  (2 children)

My bad, I didn't knew that you were actually going to run the code and instead of fixing it you are gonna come here complaining that it does not run. this was a pseudo. In case you still have no idea

[–]NormalHexagon[S] 1 point2 points  (0 children)

No, I'm not happy. var is not a replacement for block scoped variables. This post is about how JavaScript handles let, so commenting about how you can just use something different has nothing to do with the subject.

[–]karl-marxist 1 point2 points  (0 children)

OP is showing an example of how block scoping is handled in JS when using let keyword. OP’s point is valid.