The last challenge created an object with various properties. Now you'll see how to access the values of those properties.
Here's an example:
let dog = {
name: "Anakin",
numLegs: 4
};
console.log(dog.name); // would print the value Anakin
console.log(dog.name); // would print the value 4
- Dot notation is used on the object name, dog, followed by the name of the property, name, to access the value of Anakin.
Top comments (0)