Javascript Class Inheritance Tutorial

preview_player
Показать описание
A tutorial aimed at teaching beginners how to write classes and utilize basic class inheritance in Javascript.

Рекомендации по теме
Комментарии
Автор

Thanks for the video, but I am losing you on the function call section. I understand that you are inheriting the property "name" from the Human class, but why are you using the "this" keyword and why are you giving it another parameter, "name." This is really confusing me so any additional explanation would be helpful. Thank you.

jamesburns
Автор

Just to understand better. Why the function Human() it is called here a Class? but in the previous video where you introduced the concept of a function; function sayHello() was just a function. I am just trying to understand the possible difference between a Function and a Class. I'm a beginner. Thanks a lot in advance.

fjordnord
Автор

I'm know is too late (5 years, long time bro) but i really don't understand why to use that " Human.call", If an " this.name = name" is (if i understand the explanation) the same thing. Why to use this so nosense invokation format ?

If i got it, when u use Human.call(this), u are pointing to Worker instead Human, and the name call parameter is just another parameter to call the name from Worker context (the name inside Worker parameter).
I'm just staying with the idea of this.name and Human.call(this, name) are the same thing, and ignoring this call method , it's ok ? ... Btw thanks for sharing.

felipeferreira
join shbcf.ru