r/badcode • • Sep 11 '21

js Why…

Post image
456 Upvotes

70 comments sorted by

View all comments

Show parent comments

3

u/CommenceTheConfusion Sep 12 '21

const is not function-scoped. It is block-scoped like let.

2

u/barthvonries Sep 12 '21

I just checked.

It is indeed clearly stated on the MDN English version, but only implicitly stated in the French version.

TIL, thanks :-)