Tell us what’s happening:
I tried other ways too and everything else, it doesn’t give me even one thick. Is there anything I’ve been missing?
Your code so far
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
// Only change code bellow this line
function checkObj(obj, checkprop){
result = "";
if (myobj.hasOwnProperty(checkprop)){
return myobj.checkProp;
}
else{
return "Not Found";
}
}
// Only change code above this line
checkObj = ("gift");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Testing Objects for Properties
Link to the challenge: