TechWorld With Nana - The Ultimate Course for IT Beginners

TechWorld With Nana - The Ultimate Course for IT Beginners

Register & Get access to index

poonjab78

Member
TutFlixer
Mar 20, 2021
206
85
19
India
Hi Friends, this course is fantastic and brilliant curriculam to become a junior dev, but the only issue is that why she taught by using only Var keyword(data type) in the javascript section, am not sure why she taught ES6 variable like let or const intead 'var'. can any one can answer this.
var is still a very valuable part of JS if you understand the behavior. You should be using strict mode and understand how scope, hoisting, etc work. Using var makes things very easy if you are intentional in its use and want to use it across scopes. The let keyword is better suited in limited scope use where you know you only need it in a single scope, i.e. in a for loop or when you need to use some temp variables to do some calculation.

If you are going to use a variable across scopes, then var is better suited for that. I would suggest reading Kyle Simpson's explanations with examples to better understand it. Also, you will still find code in the real-world where var is predominantly used. So, you should understand how it works.
 
  • Like
Reactions: JSLover

Latest resources