I’m currently having trouble creating the code using var lookup method. (Yes, I checked the HINT which displayed a solution using IF/ELSE, but I went in this direction and am currently stuck. Please help me understand what I’m missing/doing wrong (probably everything lol but I’d still like to know what I did wrong). THANK YOU SO MUCH!
function checkObj(obj, checkProp) {
// Only change code below this line
var checkObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
return checkObj[checkProp];
return "Not Found";
// Only change code above this line
}
I was kinda basing it off the example and using the array key lookup method (and information found for what the excercise is “testing” for) . So I’m guessing this is NOT the way?