Tell us what’s happening:
Describe your issue in detail here.
i have issues with the last point, that have to say “Not found” when pony is not.
but when i delete pony, the first item that have to say whats pony is… don’t pass…
**Your code so far**
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
function checkObj(obj, checkProp) {
// Only change code below this line
if (myObj.hasOwnProperty(checkProp)) {
return myObj[checkProp];
} else {
return "Not Found";
}
// return "Change Me!";
// Only change code above this line
}
checkObj("gift");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
function checkObj(obj, checkProp) {
// Only change code below this line
if (myObj.hasOwnProperty(checkProp)) { // you say that i have to change this line?
return myObj[checkProp];
} else {
return "Not Found";
}
// return "Change Me!";
// Only change code above this line
}
checkObj("gift");
This shouldn’t show up anywhere inside of your code.
These are the two variables you have to work with.
I’ve edited your post 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.