This is more of a general query rather than about specific code. I am working my way through the Return II tutorial and have been using var and function. In these forums I see a lot of people using let instead of var, and const instead of function. Why is this? It seems that let and const might be a new standard, but if so, why are my tutorials still using the old ones?
let and const where introduced in es6 (released in 2015), they offer a block scope rather then a function scope (var)
the last one teaches es6
I think you should learn es6, if the browser support isn’t enough for your website you can always transpile the code into es5 using webpack.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.