Journal Day 1 Week 2
# Journal Day 1 Week 2
What is Scope ?
What is Hoisting ?
In what cases might you use let vs const vs var?
Scope is how far the variable move, and how much code they are in. Var is a global scope, so even if you make it in a function, it will go everywhere. Let and Const are local scopes, meaning they only exist in where they were created.
Hoisting is where you call the variable before it is defined. The variable gets made, but undefined.
You would use var if you want a global variable, but the dangers is it could override something you don't mean to. Let is if you want to update something, but just inside a function, and const is if you want something absolutely stuck, and doesn't change at all.
Link to Work https://github.com/JordanWilker/Week-2-Day-1