In the “Global Scope and Functions” lesson, it is said that you should always use “var” because of the problems you may encounter when you use other declarations. But isn’t it exactly opposite right now when the ES6 has been added (In 2015 btw)? I don’t know if this was made on purpose or maybe because the lessons are a bit outdated, but “let” and “const” variables give you much more control over your code. And from what I know, it is considered a bad practice to use “var” because of this.
the current version of the curriculum is a few years old, ES6 like let
and const
are introduced later. (it’s in progress a new version)
consider it as always declaring your variables
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.