# Doesn't Work Tried Hint In Object Oriented Programming Please Help

**URL:** <https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [June 10, 2020, 9:43pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772 "2020-06-10T21:43:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakiyare0223](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zakiyare0223/32/150561_2.png) [@zakiyare0223](https://forum.freecodecamp.org/u/zakiyare0223)\
**Post date:** [June 10, 2020, 9:43pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/1 "2020-06-10T21:43:40Z")

</div>

**Tell us what’s happening:**  
My code isn’t working

**Your code so far**

```js

let canary = new Bird("Tweety");
let ownProps = [];
// Add your code below this line
for (let property in canary) {
if (canary.hasOwnProperty(property)) {
  ownProps.push(property);
}
}

```

**Your browser information:**

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

**Challenge:** Understand Own Properties

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Sky020](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sky020/32/128093_2.png) [@Sky020](https://forum.freecodecamp.org/u/Sky020)\
**Post date:** [June 10, 2020, 9:45pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/2 "2020-06-10T21:45:44Z")

</div>

Hello there,

You appear to have deleted some code you should not have. I recommend you reset the challenge, and start again.

Hope this helps

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 10, 2020, 9:51pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/3 "2020-06-10T21:51:27Z")

</div>

You likely just copy and pasted the solution from the hints page, it is missing the constructor function. You can add the Bird constructor back at the top.

```auto
function Bird(name) {
  this.name = name;
  this.numLegs = 2;
}

```

Edit: I added the constructor to the solution.

---

<div class="post-metadata">

**Author:** ![zakiyare0223](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zakiyare0223/32/150561_2.png) [@zakiyare0223](https://forum.freecodecamp.org/u/zakiyare0223)\
**Post date:** [June 10, 2020, 9:53pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/4 "2020-06-10T21:53:15Z")

</div>

> [@lasjorg](#):
>
> function Bird(name) { this.name = name; this.numLegs = 2; }

thank you it made the tests pass

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 10, 2020, 9:57pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/5 "2020-06-10T21:57:43Z")

</div>

No problem, happy to help. As an added bonus we got the hint solution fixed as well.

Happy coding!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 12:45pm UTC](https://forum.freecodecamp.org/t/doesnt-work-tried-hint-in-object-oriented-programming-please-help/401772/6 "2021-06-01T12:45:44Z")

</div>

Closed on June 1, 2021, 12:45pm UTC


