I am so confused with **Testing Objects for Properties**

Tell us what’s happening:
Describe your issue in detail here.
Testing Objects for Properties

Sometimes it is useful to check if the property of a given object exists or not. We can use the .hasOwnProperty(propname) method of objects to determine if that object has the given property name. .hasOwnProperty() returns true or false if the property is found or not.

Example

const myObj = {
  top: "hat",
  bottom: "pants"
};

myObj.hasOwnProperty("top");
myObj.hasOwnProperty("middle");

The first hasOwnProperty returns true , while the second returns false .

Modify the function checkObj to test if an object passed to the function ( obj ) contains a specific property ( checkProp ). If the property is found, return that property’s value. If not, return "Not Found" .

The requirements to complete this :
checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift") should return the string pony .

checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "pet") should return the string kitten .

checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house") should return the string Not Found .

checkObj({city: "Seattle"}, "city") should return the string Seattle .

checkObj({city: "Seattle"}, "district") should return the string Not Found .

checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return the string Not Found .

  **Your code so far**

function checkObj(obj, checkProp) {
// Only change code below this line

return "Change Me!";
// Only change code above this line
}

Challenge: Testing Objects for Properties

Link to the challenge:

It comes in handy when you are programming for a big projects cause sometimes , you got to test if an object has a particular property or not , to avoid naming conflicts .
So pls the .hasOwnProperty is very useful and really easy to understand pls.so pls be clear on what you dont understand so we could be of help

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.