New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement - Change the names of the properties to be without "" so it is less cofusing #12125
Comments
@lh15 Can you please explain more about what's confusing about the instructions? Thanks. |
In the original broken code, hat, shirt and shoes are in ""(strings), however when accessing via a dot, strings dont work. // Only change code below this line var hatValue = testObj; // Change this line |
I can pass the challenge with: var testObj = {
"hat": "ballcap",
...
...
};
var hatValue = testObj.hat;
... That is with the original code. Can you post a few Screenshots of the issue, with the tests not working in your case? |
So it works and passes the test. I just think that for a newbie, the fact the in the object then names are "strings" and when you access it in var hatValue = testObj.hat;, can be very confusing. Strings dont work when accessing the object. That was the trouble i had. |
Hmm, I can see how the seed code and the examples are creating a confusion, need to revisit this challenge, and the other object access challenges a bit more. /cc @FreeCodeCamp/moderators thoughts? |
@raisedadead I agree. I've seen quite a few issues about dot notation vs. bracket notation. They show that the way we teach this isn't clear to many people. I'm not aware of whether the curriculum expansion takes care of this or not. I think removing the quotes in this exercise would be a good change, as it makes it more consistent with the description. Overall, I think we may need to revisit how we teach objects. It's not something that's easy to explain or understand, so I'm not sure if we could do better, but it's probably worth taking another look at it. |
thanks, @systimotic let's continue the discussion on #12141 |
Challenge Accessing Objects Properties with the Dot Operator has an issue.
User Agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
.Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
The text was updated successfully, but these errors were encountered: