Help i relly have no idea whats happening

Tell us what’s happening:

I want to learn code and I just dont get it someone please help a lost soul

Your code so far


function checkObj(obj, checkProp) {
// Only change code below this line
return "Change Me!";
// Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36.

Challenge: Testing Objects for Properties

Link to the challenge:

In the last few challenges you have started to learn what objects are.
Something like this:

let obj = {
  'property': 'first prop',
  'second-prop': 'bear',
  'something else': 'water'
}
  

The things on the left are properties of the object.
Sometimes you want to know if an object has a property so for that you have the function:
.hasOwnProperty()

As you can see in the challenge:

var myObj = {
  top: "hat",
  bottom: "pants"
};
myObj.hasOwnProperty("top");    // true (you can see that myObj has a property called 'top')
myObj.hasOwnProperty("middle"); // false (however it doesn't have a property called 'middle')

So hopefully by repeating these basics the following is now a bit clearer:

1.Check if the given object has the given property. (the object and the property are passed into the function ‘checkObj’)
2. if it does, return the property.
3. otherwise return ‘Not found’