function checkObj(obj, checkProp) {
// Only change code below this line
if(obj.hasOwnProperty("checkProp")) {
return obj[checkProp];
}else {
return "Not Found"
}
return
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Testing Objects for Properties
By putting checkProp in quotes, you are checking if it has a specific property named “checkProp”. You don’t want to check that, you want to check for the string contained in that variable. You want the variable there, not a string literal. Does that makes sense? You referenced the variable correctly here:
return obj[checkProp];
There you didn’t put quotes around it because you (correctly) didn’t want a prop specifically named “checkProp” but one with a name that matches what is in that variable.