re: Have you heard about hoisting in Javascript? This is what it is. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I disagree with "The solution is to declare your variables at the beginning of your code". Because the "code" which matters for hoisting is the fu...
 

Hey Denis Seguret thanks for your feedback. Probably I don't was very specific with that. You are right, by saying that 'the solution is to declare your variables at the beginning of your code' I was meant to declare them in the beginning of the scope you are in. Also, for sure is a good practice to always use let instead of var, because when you defined a variable using var is available in the global scope. I think I will update it. I assumed the scope concept was understand it.

code of conduct - report abuse