I'm confused on what to do in testing objects for properties

Tell us what’s happening:
Describe your issue in detail here.
Hey! so am doing this lesson on testing objects for properties, and I’m stuck in “return that property’s value” I don’t really understand what I’m supposed to do there

  **Your code so far**

function checkObj(obj, checkProp) {
// Only change code below this line
 if (checkObj.hasOwnProperty(checkProp)) {
   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/91.0.4472.124 Safari/537.36

Challenge: Testing Objects for Properties

Link to the challenge:

If you have the object

const people {
    ArielLeslie: "awesome"

The the value of people's ArielLeslie property is "awesome".

sorry but I don’t really get you

Then can you talk more about what you do and don’t understand? What, specifically, do you need help with?

Here it is, in the second line of the second paragraph it says "If the property is found, return that property’s value. If not, return “Not Found”. So am kind of lost there.



What part? Do you understand what a property is? Do you know what it means when it says “if the property is found”? Do you know how to return a value? What part of the instruction is confusing?

returning the property’s value

// if you want to return this value
const myVal = 'example';

// you do this
return myVal;

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