# How to explain prototype & class with 2 code examples

**URL:** <https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923>\
**Category:** General\
**Created:** [August 24, 2016, 9:35pm UTC](https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923 "2016-08-24T21:35:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaji1](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@xiaji1](https://forum.freecodecamp.org/u/xiaji1)\
**Post date:** [August 24, 2016, 9:35pm UTC](https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923/1 "2016-08-24T21:35:39Z")

</div>

I have some questions with 2 codes, these are the 2 codes: [https://repl.it/Cqqr/1](https://repl.it/Cqqr/1), [https://repl.it/CqrM/4](https://repl.it/CqrM/4). So what is prototype really? what is class really? what is the difference between prototype and class?

```auto
console.log(myFather)//why here will not show 'nationality: English'?
console.log(myFather.nationality)//why here do show ' English'?, console.log(myFather);//why here NOT show the method 'name: [function]'?
console.log(myFather.name)//why here do show'function'?

```

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [August 24, 2016, 10:08pm UTC](https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923/2 "2016-08-24T22:08:56Z")

</div>

Maybe this video will help:

---

<div class="post-metadata">

**Author:** ![xiaji1](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@xiaji1](https://forum.freecodecamp.org/u/xiaji1)\
**Post date:** [August 25, 2016, 2:03am UTC](https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923/3 "2016-08-25T02:03:07Z")

</div>

i have already watched this video, but it did not give me much clarification, is there any article can explain better?

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [January 16, 2021, 5:29am UTC](https://forum.freecodecamp.org/t/how-to-explain-prototype-class-with-2-code-examples/30923/5 "2021-01-16T05:29:04Z")

</div>

Closed on January 16, 2021, 5:29am UTC


