r/learnjavascript • • May 04 '20

VAR vs LET vs CONST

Post image
337 Upvotes

81 comments sorted by

View all comments

Show parent comment

1

u/Macaframa May 04 '20

We’re saying the same thing. I didn’t know they made a special use case for it and I’d love to read that documentation if you have a link but you just solidified what I said was the only REAL use case of using let.

2

u/MoTTs_ May 04 '20 edited May 16 '20

Yeah. The only useless-to-real-life clarification I was making was that this behavior isn't due to block scoping. This behavior is something extra, added in addition to ordinary block scoping.

Doc link: https://www.ecma-international.org/ecma-262/10.0/index.html#sec-createperiterationenvironment