Tell us what’s happening: I have the same code as the video does (my code is on the bottom), but only the code works when copy and pasted. This also happened on a different JS lesson.
Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
//video code
if(obj.hasOwnProperty(checkProp)) {
return obj[checkProp];
} else {
return "Not Found";
}
//my code
if(obj.hasOwnProperty(checkProp)) {
return obj[checkProp];
} else {
return "Not found";
}
// Only change code above this line
}
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 12871.102.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36
.
Challenge: Testing Objects for Properties
Link to the challenge: