function checkObj(obj, checkProp) {
// Only change code below this line
if(obj.hasOwnProperty(checkProp)){
return obj.checkProp;
}
else{return "Not Found";}
// Only change code above this line
}
i got it to work by substituting obj.checkprop with object[checkprop] however if the bracket and dot notations are fundamentally 2 ways of doing the same thing i must be missing something ?
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.