Lesson failure using bracket notation

Tell us what’s happening:
This lesson does NOT accept the bracket notation to access the object properties.

Your code so far


let dog = {
name: "Spot",
numLegs: 4
};
// Only change code below this line
console.log(dog["name"]);
console.log(dog["numLegs"])

/* it returns:
Your code should use console.log to print the value for the name property of the dog object.
Your code should use console.log to print the value for the numLegs property of the dog object.
// tests completed
// console output
Spot
4
*/

As can be seen it access the properties, and can console the correct values, but does not accept them.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0.

Challenge: Use Dot Notation to Access the Properties of an Object

Link to the challenge:

as the name of the challenge says, you are expected to use dot notation


if you think it’s a bug…

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like