Reading Properties
Get values from objects.
Peeking Inside the Chest 🔍
You built a treasure chest (object). Now let us peek inside and grab a treasure!
Getting a value out of an object is called reading a property. 🪙
The Magic Dot ✨
To grab a treasure, write the chest name, a dot ., then the key.
Like saying: dog DOT name, please! 🐶
let dog = { name: 'Rex', age: 4 }
console.log(dog.name)All lessons in this course
- What Is an Object?
- Reading Properties
- Changing Properties
- A Pet Object