Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics Working with Strings Combine Strings

Emre K.
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emre K.
Full Stack JavaScript Techdegree Graduate 16,408 Points

String Concatenation with const

Hello Treehouse members,

In this course, Guil teaches how to combine strings. What confused me was the fact that we learned earlier that we cannot change the value of a constant ("const") once established. However, I see in the video that the instructor overrides and redefines the value of const message.

Do you know how this does not cause any issues considering const may not be changed after defined and assigned?

Source video URL: https://teamtreehouse.com/library/combine-strings

Thank you for your time in advance.

1 Answer

M. Emre Kayan He never actually reassigns any data to const. If you watch to the end of the video you will see that his attempt to concatenate to const results in an error message and he eventually replaces the "const" keyword with the "let" keyword. Let me know if there is anything unclear about this answer, I hope it helps!

Emre K.
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emre K.
Full Stack JavaScript Techdegree Graduate 16,408 Points

Ryan,

First of all, thank you very much for your time and reply. The answer is very clear now. I have been studying the Tech Degree all day and should probably take a break to regain focus.

No problem! These things happen to all of us!