-3
It almost worked but I’d like to know what’s missing in the code, something else to add?
function checkObj(obj, checkProp) {
// Only change code below this line
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
if (checkObj = myObj.hasOwnProperty) {
return myObj[checkProp]
} else{
return "Not Found";
}
// Only change code above this line
}
function checkObj(obj, checkProp) {
// Only change code below this line
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
if (checkObj = myObj.hasOwnProperty) {
return myObj[checkProp]
} else{
return "Not Found";
}
// Only change code above this line
}
The code you have presented works perfectly. Maybe there is more code that you have not shown and is generating this error.
– JeanExtreme002
@Jeanextreme002 what other code would you use? Because I’m testing numerous options here but none of them work
– Lucas Vinicius
How so what other codes would I use? What I meant to you is that only this snippet that code you put in the question does not generate error.
– JeanExtreme002
with this code almost worked: Function checkObj(obj, checkProp) { // Only change code Below this line var myObj = { Gift: "Pony", pet: "Kitten", bed: "Sleigh", city: "Seattle" }; (checkObj = myObj.hasOwnProperty) { Return myObj[checkProp] } Else{ Return "Not Found"; } // Only change code above this line }
– Lucas Vinicius