Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
if checkObj(obj){
gift: "pony"
pet: "kitten"
house: "Not Found"
city: "Seattle"
district: "Not Found"
}
return "Change Me!";
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36
Thank you for getting back to me. I am trying to figure this part out from the module: " Modify the function checkObj to test if an object passed to the function ( obj ) contains a specific property ( checkProp ). If the property is found, return that property’s value. If not, return "Not Found" ."
You ought to modify line 3 so that if obj has a property called checkProp(as entered in the function call) it should return the value of that property else return “Not Found”.
Use .hasOwnProperty to do the checking and add an else line.
I hope I helped make your life easier.
Hello @morifingk just as @JeremyLT as said you need to be quite specific in what the problem is for others to be able to help.
Here’s your first mistake :
This is an if statement and should only contain conditions inside the parenthesis (). You seem to be treating this as a function checkObj().
You would want to have your object stored in a variable outside of the function because you would be passing that object as an argument to the function.
Each time you set a property: value for an object you should always separate them with a comma the last property is considered optional.
Lastly in your conditional statement I believe you would need to return a certain value if it is found in the object that is being passed to the function. Check the examples given and then you can come back here if you’re still stuck.