DEV Community

Discussion on: Var and Function Scope In Javascript

Collapse
 
donovantaitt profile image
Donovan Taitt

Moving forward I would say, don't use var anymore. Ever since 2015, the industry has been moving away from it in favor of let and const. Any time you see var in the wild, it's probably old code examples that haven't been updated in a while. If you're confused when seeing examples online, you can mentally replace them with let. Hope that helps!

Collapse
 
jijii03 profile image
lincey.J

thanks for the advice it help a lot!

Thread Thread
 
donovantaitt profile image
Donovan Taitt

No problem!