From the course: JavaScript Essential Training

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Object containers

Object containers

- Now that we have an overview, let's dig a little bit deeper and really understand how an object fits together. The object needs somewhere to live and it needs a name. For this, we use a container called a variable. And in this case, it's a constant variable. The const keyword says, this is a constant. The name is the name we use to reference this particular container. And whatever's on the right hand side of the equal symbol is what goes inside the container, what is assigned to that container or to that variable. In this case, an object. Now this is a constant, meaning while we can change the properties of the object inside the container, we can't remove or replace the object from the container. If we try to do so by calling the constant name and using the equal symbol to set the contents to something else, the browser will tell us you can't do that. This is a constant. Let me show you. In the exercise files…

Contents