Prototype Inheritance In JavaScript | JavaScript Tutorial In Hindi #30

preview_player
Показать описание
In this Javascript tutorials in Hindi lecture, I have thrown light on Object prototype & __proto__ in JavaScript
This video is a part of my JavaScript In Hindi Course. JavaScript tutorial in Hindi was one of the most requested course on this channel. I hope you are enjoying this course!

Best Hindi Videos For Learning Programming:

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Combining video lectures, source code & explanation can easily beat any paid courses.
Thank you harry Bhai.

patelrajkumarnareshkumar
Автор

Great Harry Bhai 👍

// food for cake
function food(maida, cokopowder, sugarpowder) {
this.maida = maida;
this.cokopowder = cokopowder;
this.sugar = sugarpowder;
}

food.prototype.bake = function() {
return 'Choco Cake is ready';
};

let flour = new food('maida', 'coko', 'sugar');


function cake(maida, cokopowder, sugarpowder) {
//Inheritance
food.call(this, maida, cokopowder, sugarpowder);


}

//Inheritance of prototype
cake.prototype =

let chocoCake = new cake('Maida', 'coko', 'sugar');

FightAgainstMathsFear
Автор

Best JavaScript Tutorial With Easy Explanation !
Thankyou So Much Harry, For This Superb Content ♥️

iamaniketkr
Автор

Amazing JavaScript Course on YouTube 🥳🥳🥳🥳

rajusheoran
Автор

function flour(price, type){
this.price = price;
this.type = type;

}

let cup = new flour('2000', 'Wheat');
console.log(cup);

function cake(price, type, flavour){
flour.call(this, price, type);
this.flavour = flavour;

}

let cupCake = new cake(2500, "Birthday Cake", "Strawberry");
console.log(cupCake);

MohammadASIF-hddm
Автор

Bhaii yrr tu to great hai, dil se❤

I will support u if you start even paid content too

nm_nishant
Автор

Harry bhai REACT JS par bhi Playlist create karena

muhammadahsansardar
Автор

pls harry bhai REACT Pe ek series launch kro

ashishsingla
Автор

// QUIZ :
// inerit flour to make a cake :

//ANS :
function flour(price, quantity, brand) {
this.price = price,
this.quantity = quantity,
this.brand = brand
}
flour.prototype.howToMakeIt = function() {
return `refer youtube`;
}

let flourObj = new flour(100, 10, 'aashirwad aata');
console.log(flourObj);

//inheriting:

function cake(price, quantity, flavour, brand) {
flour.call(this, price, quantity, brand);
this.flavour = flavour;
}
//inherting the prototype of flour constructor :
cake.prototype =
//inherting the comstructor:
cake.prototype.constructor = cake;

let cakeObj = new cake(1000, 1, 'butterscotch', 'homemade');
console.log(cakeObj);

yashdewan
Автор

Best java script tutorial...bolo Tara Ra Ra.

renuswami
Автор

14:15: Sir, if we are inheriting already from employee class & also we are writing our own. So what is the use of inheriting?

neilrehani.
Автор

var flour=function(material, water)
{
this.cakematerial=material;
this.cakewater=water;
}
var cake=function(material, water, price, type)
{
flour.call(this, material, water);
this.cakeprice=price;
this.caketype=type;
document.write(this.cakematerial, this.cakewater, this.cakeprice, this.caketype);
}
new cake("floor", "plain water", 220, "Chocolate");

FaizanAli-xpqi
Автор

Harry bhai has a true friend Rohan Das 😂❤, thanks for the tutorial 😇

priyasrivas
Автор

thank you so much harry sir, u r very humble..

rubinarumi
Автор

quiz solution

function flour(egg, premix, sugar){
this.egg = egg;
this.premix = premix;
this.sugar = sugar;

}
flour.prototype.slogan = function(){
return `This is the best cake`
}

let Cake = new flour(2, '500g', '200g')
console.log(Cake);

sohamkokateee
Автор

please increase font size so it can visible

nirvikar
Автор

Rohan das ko 2rs aur 0 years ka experience, Kya baat hai 🤣🤣🤣

ACHTech
Автор

// exercise
function Items(eggs, whiteSugar, milk, chocolate) {
this.eggs = eggs;
this.whiteSugar = whiteSugar;
this.milk = milk;
this.chocolate = chocolate;
};

// Slogan
Items.prototype.slogan = function () {
return `This item is made by Harshit`
};

Let quantity = new Items (2, "1 cup", "1cup", "1 dark chocolate");
Console.log(quantity);

// Cake inherit with items
function cakeItems(eggs, whiteSugar, milk, chocolate, water, flour) {
Items.call(this, eggs, whiteSugar, milk, chocolate);
this.water = water;
this.flour = flour;
};

//
cakeItems.prototype = Object (Items.prototype);

// Inherit the prototype
= cakeItems;

// Manually set the constructor
Let cakeReady = new cakeItems (2, "1 cup", "1cup", "1 dark chocolate", "2 cups", "200g");
Console.log(cakeReady);

Harshitsingh-jfyu
Автор

function Flour(quantity) {
this.quantity = quantity;
}

Flour.prototype.Create = function (name) {
return `I am creating ${name}`;
}

function Cake(FlourQuantity, CreamQuantity) {
Flour.call(FlourQuantity);
this.CreamQuantity = CreamQuantity;
}

Cake.prototype =
Cake.prototype.constructor = Flour;

let flour = new Flour(100);


let cake = new Cake(100, 50);

manishathemahi
Автор

function flour(weight, color) {
this.weight = weight;
this.color = color;
}

function cake(color, weight, size ){
flour.call(this, weight,color);
this.size = size;

}
let dish = new cake("white", 1, "L");
console.log(dish);

mta_sandhu
visit shbcf.ru