JavaScript 中 let 與 var 的比較

在 JavaScript 中,使用 `let` 和 `var` 宣告變數時有幾個重要的區別,特別是在變數的範圍(scope)方面:

1. 範圍(Scope)

`let`

`var`

2. 重複宣告(Redeclaration)

`let`

`var`

3. 提升(Hoisting)

總結

總結