Videos
Hello, my background is java and I am trying to understand variable declaration deeper. Mainly what the differnces between let and var keywords. I found this great website for those who are still looking to understand.
https://scotch.io/tutorials/understanding-scope-in-javascript#toc-block-statements
But I am still having trouble how LET is not a global scope? If you google let vs var, you will get tons of tables like this:
But can't let be considered global too? Since I can declare it globally. Or is it referring to automatic globlazation? Where even if you declare the variable in block statement, it will automatically set it to globabal variable?
Sheesh, I have under estimated the JS. Thanks.
Keywords for people looking for this:
LET vs VAR,
GLOBAL SCOPE VS LOCAL SCOPE
Global scope vs block statement
scope vs block