var vs. let
With var
, a variable can be declared twice and the content gets overwritten:
After ES6, we can use let
to get rid of this behavior. For example, the following code will throw SyntaxError
:
Last updated
Was this helpful?
With var
, a variable can be declared twice and the content gets overwritten:
After ES6, we can use let
to get rid of this behavior. For example, the following code will throw SyntaxError
:
Last updated
Was this helpful?