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 Practice Object Basics in JavaScript Practicing Object Basics Calling a Method Solution

William Mead
William Mead
9,937 Points

Const vs Let

Here you are defining your variable with the keyword const. If the object were updated with a new value for string, would this be a problem? Should the variable be defined with the keyword let instead?

1 Answer

Steven Parker
Steven Parker
231,269 Points

Defining an object with "const" only prevents the variable referencing that object from being changed. Any properties inside the object can still be changed.

When the properties cannot be changed, the object is said to be "frozen". That's not related to the object being "const".