Im stuck , please help

I’m really not getting why i don’t pass the lesson. Can you please help me understand what i’m doing wrong. Thank you so much

  **Your code so far**

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

var obj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"

var answer  = "Not found";

if (obj.hasOwnProperty(checkProp)) {
  answer = obj[checkProp];
  return answer;

// Only change code above this line


  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36

Challenge: Testing Objects for Properties

Link to the challenge:

Hi @Maz-hub !

Welcome to the forum!

A few issues.

This text is incorrect

Check proper capitalization.

You are not supposed to create your own object.
Your function should work for ANY object.
Not just one you created yourself.

You can delete this.


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