I can not get past this test , it has been 2 weeks, someone help me please

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

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

// Only change code above this line
}

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Testing Objects for Properties

Link to the challenge:

It looks like you haven’t described what you need help with or provided any code. We can’t help you if you don’t talk to us.

1 Like

the link is there, i don’t know how this help works.

but the link to the problem is visible
thank you

I’ll echo what was said above.

What code have you written in the two weeks that you have been working on this problem? What problems have you encountered?

We’re not going to write the solution for you - that doesn’t help you and it doesn’t help us. But, we’re more than happy to answer specific questions you have about this challenge and the difficulties you’ve encountered.

function checkObj(obj, checkProp) {
}

Your function has two parameters.

The parameter ‘obj’, receives an object (ex: {property1: ‘value1’, property2: ‘value2’} ). Generally, you assign those objects to variables.

The parameter ‘checkProp’ receives a property name. If your object is {property1: ‘value1’, property2: ‘value2’} and you want to check if It has the property named ‘property1’, you would call hasOwnProperty(‘property1’) on It. You would receive true or false as a result.

To pass the exercise. First, you need to discover if the object, passed to the parameter ‘obj’ has the property name passed to the parameter ‘checkProp’. If it has, you’ll return the property value, generally, you can access the value by calling the object like this: obj[propertyName]
If your object don’t have the property. You’ll return the string ‘Not Found’

1 Like

Sorry btw. I pressed enter before finishing my comment.

thank you this helped me figure it out

1 Like

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