so firstly i’d say for a beginner this question was way too confusing i get what it was try to say but like i didn’t even know that you could pass the method .hasOwnProperty within the argument or parameter or whatever its called.
Now everything pass except the last part “gift” should return Not Found. i already put in the return statement and everything else pass why is it not passing for the last one??
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
obj={
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
if(obj.hasOwnProperty(checkProp)){
return obj[checkProp];
}else
return "Not Found";
// 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/88.0.4324.150 Safari/537.36.
wait it worked?? wait what how come? i didn’t see object being created why then would it pass the test that require it to acess gifts value or pets value?? So a obj as within a function’s parameter is the same as creating a object?
Oh so the questions assume that the values for the object eg . gift: “pony” etc are already created outside of the function so we just have to make a function to find out the properties of the said obj…is that correct?