Leo Liu's blog

归档 · 2022

首页

关于

归档

Javascript

The Var, let, Const - What's the Difference?

Aspect var let const Scope Function scope; variable is accessible inside function even if declared after usage Block scope; variable is only accessible inside nearest enclosing {…} Block scope; variable is only accessible inside nearest enclosing {…} Re-declared Can re-declare var anywhere in the function Cannot re-declare let in the same block Can..

更多