Basic JavaScript: Testing Objects for Properties Modifying checkObj

I dont understand the exercise at all . I dont know how to check Obj, by modifying it .

Hi @Lfraction11

The point of this exercise is to introduce the method hasOwnProperty(). It is used like: object.hasOwnProperty(property) If the object contains the entered property, it returns true, otherwise false.

The exercise prompt can be shortened and reformatted to:

// if "obj" contains the property "checkProp"
    // return that property's value
// else
    // return "Not Found"

PS: It’s always helpful to post exercise links with questions …

Hi there.
The motive of the challenge is to check whether your object is in the dictionary or not. I recommend you that see how they have defined the function. They have said that function is so declared that it will take two parameters first one is your object and another-parameter is going to be true or false value as you know .hasOwnProperty return only true or false. If true it is going to return that object otherwise it will return not found.You may refer to the following code.


It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Thank you for understanding.

1 Like

Sure mam, I will take care of that from onward. Thank you