Using "let" without block?

I learned that the local variable can only be used inside blocks, but I found some answer of code would not use block({}) while use let, why’s that? (Sorry for my poor English)

The let identifier allows users to declare a variable within a block of code, if there are no brackets {}, then then entire section is considered the block. This is called ‘scope’. You can read more about scope at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

2 Likes