Declaration is when you create a new variable using
const. By default, declared variables have an initial value of
Initialization is when a variable is given a value the first time. A variable can be used before initialization.
- Usable anywhere in the file where they're declared
- Declared outside any function or block of code
- Can cause problems if you're not careful with them
Follow along by forking this StackBlitz project.
For more information on this topic, check out this blog post.