Welcome to the Treehouse Community
Looking to learn something new?
Marcus Schumacher16,616 Points
Why use const here?
He said we'll store the username in a variable so we can change it later. Then he makes a constant variable called username to store the name. Why would you use const? Wouldn't that make it impossible to change the username later? Wouldn't var be just fine here? Sorry for my ignorance, but I haven't really used const that much and still don't fully understand it I guess :/
Erik Krieg43,038 Points
You are right, values declared as a
const cannot be changed in a running program. What I believe is meant here by "change later" is refactor references to the username in the code more easily. He is just promoting DRY code where the "chalkers" username isn't repeated.