Cuéntanos qué está pasando:
I just read all the posts for the resolution of this challenge and I changed as suggested in the comments but it still gives me an error when executing, when I type “city”, “gift” and “pet” it appears as if the string was not returned as it should be. I do not know what else to do
Tu código hasta el momento
var myObj = {
"gift": "pony",
"pet": "kitten",
"bed": "sleigh",
"city": "Seattle"
};
function checkObj(checkProp) {
// Your Code Here
myObj.hasOwnProperty(checkProp);
return myObj[checkProp] || "Not Found";
}
// Test your code by modifying these values
console.log(checkObj("city"));
console.log(checkObj("gift"));
console.log(checkObj("pet"));
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Desafío: JavaScript básico - Verifica las propiedades de un objeto
Enlaza al desafío: