Where communities thrive Join over 1. People Repo info. Why does the checkProp not end up being a variable in the dot example but in the bracket example it ends up being a variable? I had the the same problem. I found these information about the square bracket access and the dot access. Can anyone explain why I need to use parentheses instead of brackets around checkProp in the second line of my code that is pasted below? Please describe how to reproduce this issue, and include links to screenshots if possible.
My issue is the final 'return "Not Found"; ' statement in this exercise will not execute when the condition is false. I checked the format of this exercise with one from a previous exercise Chaining If Else Statements , and it is the same basic format once you comment out the extra if-else statements there.
I did not find any other solutions in Git Hub or elsewhere online. I did notice some people used an 'else' in front of ' return "Not Found" ; ', but when I attempt it, I get an error, otherwise, the editor does not show any other errors for my code. You have a semicolon after the if statement. It should be if myObj. Thanks and Happy Coding! SaintPeter closed this Jan 17, Why the brackets in? Any guidance is appreciated! Trying to understand the reason.