I have absolutely no idea what I did wrong...can someone help me please?

Tell us what’s happening:
I don’t know what I’ve done wrong, why won’t my code work?

  **Your code so far**

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

check (obj.hasOwnProperty(checkProp)); 
  gift: "pony";
  pet: "kitten";
  bed: "sleigh";
  city: "Seattle";
 if (obj.hasOwnProperty)
 return (checkProp);
 else {
  return "Not Found";

// 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/100.0.4896.127 Safari/537.36

Challenge: Testing Objects for Properties

Link to the challenge:

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 hard, but it 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.

There are significant syntactical errors in your code. Reading it, I’m not totally sure what it’s supported to be doing. Right from the first like there’s a call of an undeclared function (check (obj.hasOwnProperty(checkProp));) and then on the next line there are a series of assertions that look like they are defining an object’s properties, but not quite.

I suggest going back a few lessons and paying extra close attention to the syntax of the examples.

Good luck! I’m sure you’ll get it soon!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.