The let declaration has a block scope
Learn these JavaScript fundamentals and become a better developer
Cristian Salcescu
21K45

also, let doesn’t allow for re-initialization anywhere within the same scope, while var allows it. this can be especially troublesome for testing things on the console, for instance.