No video

How to Implement Inheritance in JavaScript | Function Constructor Inheritance in JavaScript

  Рет қаралды 1,208

NomadCoder

NomadCoder

Күн бұрын

This video explains how to implement Inheritance in JavaScript. The implementation of Inheritance depends on how objects are created; for instance, inheritance between two object literals is implemented differently than inheritance between function constructors.
The video explains you to implement inheritance in function constructors. To do that, you follow two steps,
Call the parent function constructor indirectly using call or apply the method to assign the common properties.
function Dog(family,name, age){
Animal.call(this,name,age);
this.family = family;
}
Link the prototype of the child function constructor to the prototype of the parent function constructor
Object.setPrototypeOf(Dog.prototype,Animal.prototype);
Please let me know in the comments your feedback and questions.

Пікірлер: 4
@abraryasirarman3557
@abraryasirarman3557 11 ай бұрын
Thanks Bro...
@mitesh5189
@mitesh5189 Жыл бұрын
tq
@vishalisharani1410
@vishalisharani1410 Жыл бұрын
Can we use Arrow functions as a prototype function?
@frontenddeveloper9173
@frontenddeveloper9173 Жыл бұрын
no we cannot because in arrow function the "this belong to window object" so we use a anymous function so the this refer to that label which we calling. Hope my answer help you thanks.
Inheritance between function constructors in JavaScript
20:48
What is Prototype Chaining in JavaScript
15:33
procademy
Рет қаралды 8 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 29 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 15 МЛН
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 22 МЛН
16.17: Inheritance in JavaScript - Topics of JavaScript/ES6
17:47
The Coding Train
Рет қаралды 79 М.
Inheritance in JavaScript - Prototypal Inheritance tutorial
20:06
JavaScript Prototypal inheritance - Tutorial
15:29
ColorCode
Рет қаралды 76 М.
JavaScript Factory Functions and the Prototype
7:57
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 3,5 М.
Function Overloading in TypeScript (I was wrong)
10:24
Andrew Burgess
Рет қаралды 13 М.
JavaScript Prototype and Inheritance
11:41
procademy
Рет қаралды 1,7 М.
Inheritance between Classes in JavaScript
10:12
procademy
Рет қаралды 3,1 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН