Examples of using let variable in basic projects

I’m currently learning about let variables and am a little bit confused about ways to use them. What would be a good reason/example to not assign a value to a variable name using let, and then later assign a value to that variable name?

https://www.codecademy.com/paths/full-stack-engineering-cfb/tracks/fscp-javascript-syntax-part-i/modules/fecp-learn-javascript-syntax-introduction/lessons/variables/exercises/let

let changeMe = true; changeMe = false; console.log(changeMe);

One example I can think of is if you are using the let variable to store ‘string’ data-type, you can just declare the variable without a value, then later you can assign it to string data-type value.

let myString; myString = "some string"; console.log(myString) //expected output: some string
1 Like

ahh okay, I appreciate the help!

1 Like