Testing objects(fcc)test


// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  if(checkProp === myObj["gift"]){
  return "Yes";
  }
  return "Not Found";
}

// Test your code by modifying these values
console.log(checkObj("gift"));

I tried the condition as ,if checkprop is equal to  the prop of myObj then it returns Yes.It is not the actual challenge but I am just testing it

Can you further clarify the issue?

I think i get you.

Try passing “pony” as parameter for checkObj function inside console.log, you will get it.

Its the testing Objects challenge from basic JS,We have to test if the object property is existed or not.

Yes I got it,but how to test if its a property of the object.

Have a look at this, you can filter if the value passed is property or not using this.