Prototype and Prototypal Inheritance in Javascript | Frontend Interview Question

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 มี.ค. 2019
  • - What is Prototype?
    - What is Prototypal Inheritance?
    - What is Prototype Chain?
    - Why we call it _proto_ ?
    - What is inhertance in Javascript?
    If this video was helpful, give it a thumbs up and subscribe to my channel for more such videos. 🔔
    Link to Subscribe: th-cam.com/users/akshaymarch...
    If you want me to cover any specific topic, then comment down below. I would be happy to help you.
    If you find my videos helpful,
    then please support this channel by buying a coffee,
    www.buymeacoffee.com/akshayma...
    Cheers,
    Akshay Saini
    akshaysaini.in
    Would love to Stay Connected with you ❤️
    LinkedIn - / akshaymarch7
    Instagram - / akshaymarch7
    Twitter - / akshaymarch7
    Facebook - / akshaymarch7
    #Javascript #JavascriptInterviewQuestions #AkshaySaini

ความคิดเห็น • 458

  • @zahebshamsi
    @zahebshamsi 5 ปีที่แล้ว +222

    First i like your video then watch it. :P

  • @techtube2404
    @techtube2404 3 ปีที่แล้ว +20

    awesome explanation. First, I used to read on MDN then refer to any video/blogs/articles for a simpler and short explanation. Now firstly I'll watch your video then refer any other study material. Please never stop making such great videos.

  • @anjalii1102
    @anjalii1102 ปีที่แล้ว +65

    inheritance in JS => When an object trying to access variables and properties of another object
    prototype is an Object that get attach to function/method/object and this object has some hidden properties
    Whenever we create object/ function/ methods/ array/ variable , these all are attached with some hidden properties, which we call prototype
    __proto__ is reference to prototype ( or it points towards prototype ), if we want to access prototype, we do __proto__
    prototype object has a prototype of its own, and so on until an object is reached with null as its prototype, this is called prototype chaining

    • @AkashhGuptaa
      @AkashhGuptaa 9 หลายเดือนก่อน

      Thanks for summarizing buddy

    • @porobertdev
      @porobertdev 7 หลายเดือนก่อน +4

      Just wanna point out that the __proto__ is an old method. There's a new method (somewhat inconvenient if you ask me): Object.getPrototypeOf(obj).
      Learned from TheOdinProject 🙂

    • @astroflexx82
      @astroflexx82 3 หลายเดือนก่อน

      Don't use __proto__ to access an object prototype, use Object.getPrototypeOf() instead.

    • @ishratkaur1605
      @ishratkaur1605 13 วันที่ผ่านมา

      is prototype an Object or a property ?

  • @prateekgautam7398
    @prateekgautam7398 4 ปีที่แล้ว +11

    Honestly, Your last mybind example made me understand even more better. That was good. Keep up the good work sir.

  • @mohanrawat5052
    @mohanrawat5052 3 ปีที่แล้ว +3

    the most beautiful and well organized videos that i have ever encountered to youtube. THanks myan! looking forward when the new videos are coming

  • @sohailmohammed4024
    @sohailmohammed4024 5 หลายเดือนก่อน +9

    Interviewer asked me same question I explained it beautifully and he was surprised on my explanation and I got selected in interview too
    Thanks to Akshay brother for giving super content

    • @error04354
      @error04354 4 หลายเดือนก่อน

      Hey can explain and advice what is the major and important interviewers are ask the question. What I do for interview

    • @subhanginimohapatra896
      @subhanginimohapatra896 24 วันที่ผ่านมา

      which company and for what role

  • @disenchanted_dove
    @disenchanted_dove 5 ปีที่แล้ว +10

    Awesome video Akshay!
    Just a side note that strings,arrays all get coerced​ into its object equivalent called as wrapper object when we try to access the built in properties. This is the reason why we use the dot(.) Operator to access them.

  • @countmein5164
    @countmein5164 2 ปีที่แล้ว

    Idk wtf I was doing 3 yrs ago but here I am. Learning js from gold contents. Thanks for Namaste JavaScript episodes🎉

  • @ashwanikumar183
    @ashwanikumar183 4 ปีที่แล้ว +67

    I was quite confused by this topic for a long time, you make it simple and great explanation. I would genuinely request you to create the JavaScript Series for all the possible topics.

    • @canyouvish
      @canyouvish 9 หลายเดือนก่อน +1

      and now we have Namaste Javascript ♥

  • @somewhere_in_bharat
    @somewhere_in_bharat 3 ปีที่แล้ว +2

    Subscribed. Finally found someone who is teaching in a way I want to be taught or I teach someone. Thanks, dude!!

  • @dhruvthakkar4350
    @dhruvthakkar4350 2 ปีที่แล้ว +3

    Extremely well explained. I watched from udemy paid course but couldn't understand. but this person explained me perfectly.

  • @NuhAleph
    @NuhAleph 4 ปีที่แล้ว +4

    I found my javascript tutor. Thank you, god bless you.

  • @bhaveshmaisuria544
    @bhaveshmaisuria544 4 ปีที่แล้ว +4

    Really Deep dive coching. First time clearing concepts...Rocking.

  • @raviaryan6723
    @raviaryan6723 4 ปีที่แล้ว +3

    first time i watched your video and understand what really is a prototype. Thanks for the wonderful explanation in the coding way.

  • @abs542
    @abs542 4 ปีที่แล้ว +5

    Very helpful. Easily understood otherwise a
    highly confusing topic. Keep up the good work.

  • @rohitkudalkar92
    @rohitkudalkar92 4 ปีที่แล้ว +6

    i feel lucky to found your channel. Love ❤️ and Support.

  • @abhijeetyadav1647
    @abhijeetyadav1647 5 ปีที่แล้ว +14

    If not the best content out there on prototypal inheritance, it surely bridged the knowledge gap between __proto__ and prototype. Thanks Akshay for the video. keep up the good work.
    Quick tip: __proto__ is on the object instance, prototype is on the constructor function.

  • @adnanahad
    @adnanahad 3 ปีที่แล้ว

    Aap hi ho jo itna deep padhata h aur itne ache se padhata h...
    Aur sab kuch smj aata h...
    Practice karne mai b maza aata hai really thankful to you...
    I love u sir...please make more videos in namaste javascript

  • @tauseefanwardo
    @tauseefanwardo 2 ปีที่แล้ว

    I was lost and here you are man! Lovely, marvelous, mind boggling, seriously man, you make javascript fun to learn.

  • @rishikeshsanjekar1349
    @rishikeshsanjekar1349 2 ปีที่แล้ว

    I've watched many JS tutorial on TH-cam but your explanation is totally different
    You are JavaScript King 👑

  • @milosleng1175
    @milosleng1175 3 ปีที่แล้ว +2

    good videos bro. I have watched tons of Videos on YT on the topics you presented, but sometimes things do not click on the first time, etc, so I keep coming back to the concepts that cause me issues. I love simplicity of your channel, you really helped me clear some things up! cheers!

  • @amitsingh-rb6jl
    @amitsingh-rb6jl 2 ปีที่แล้ว +1

    Much better explanations than all the videos I have watched till now on this topic, liked the video as soon as I got what you were explaining. Now subscribing to your channel for the depth of knowledge you are trying to provide thanks a lot it helped a lot.

  • @gururajchadaga
    @gururajchadaga 2 ปีที่แล้ว +3

    This channel's content gives me so much confidence.
    Thank you so much.

  • @AbhishekSharma-cq2hw
    @AbhishekSharma-cq2hw 3 ปีที่แล้ว +1

    Thanks for making this extremely helpful video!!
    Even though this somewhat a confusing topic for me, I do have a much better understanding of prototypal inheritance after watching this video :)

  • @alpaytripleplay5150
    @alpaytripleplay5150 3 ปีที่แล้ว

    finally an explanation that does not use animal/user constructor functions for examples. using arrays/objects for examples finally helped this topic click better for me

  • @ameyzulkanthiwar9148
    @ameyzulkanthiwar9148 5 ปีที่แล้ว +2

    Thank you for explaining in a practical way. It is very helpful.

  • @aparnaiyer5873
    @aparnaiyer5873 2 ปีที่แล้ว +1

    WONDERFULLY EXPLAINED ! IT IS RIGHTLY SAID THAT IF YOU CAN NOT EXPLAIN IT SIMPLY ENOUGH THEN YOU DO NOT UNDERSTAND IT... THANK YOU VERY MUCH !

  • @SachinPatel-iw5qi
    @SachinPatel-iw5qi 3 ปีที่แล้ว +1

    Best explanation i've ever found out on prototype chaining..

  • @vikas.gaurav
    @vikas.gaurav 3 ปีที่แล้ว +13

    I read it many times from MDN but never understood it completely, now it is done😍

    • @arghyaghosh2515
      @arghyaghosh2515 3 ปีที่แล้ว

      Same bro🤣🤣🤣

    • @BittuKumar_Web
      @BittuKumar_Web 3 ปีที่แล้ว +2

      what has to do in place of, object.__proto__= object2.
      he suggested not to do like this. what has to do in place of this.

    • @aashishomre1624
      @aashishomre1624 ปีที่แล้ว

      use Object.create(object2)

  • @sumer9999
    @sumer9999 5 ปีที่แล้ว +1

    Great Work Akshay, thanks for posting this

  • @vishwasrvishu9267
    @vishwasrvishu9267 3 ปีที่แล้ว +1

    The most important thing I like in your videos …. You always have that confidence on :-)

  • @ananyajain8528
    @ananyajain8528 2 ปีที่แล้ว

    Thank you Akshay for all the wonderful and easy explaination. I always watch your videos before the interviews. ♥️

  • @adityaagrawal4466
    @adityaagrawal4466 ปีที่แล้ว +1

    you know what's more beautiful than functions in javascript, it's your teaching style ❤

  • @jeet_j7
    @jeet_j7 ปีที่แล้ว +1

    2,3 jagah videos dekhi samajh nahi aaya bilkul bhi...yha akdam mast samajah aaya. Thank you bro❤

  • @commondev2595
    @commondev2595 3 ปีที่แล้ว

    Your videos are enough to crack most of the JavaScript inteviews

  • @dipteshmukherjee346
    @dipteshmukherjee346 3 ปีที่แล้ว +1

    guru ho aap , real guru , love the way you teach

  • @mustang7ist
    @mustang7ist 2 ปีที่แล้ว

    Wow, your break things down so very well. Thank you for this!!

  • @sindhu1345
    @sindhu1345 4 ปีที่แล้ว +4

    Possibly the best explanation so far. Simple and easy to understand, great job man!!

    • @akshaymarch7
      @akshaymarch7  4 ปีที่แล้ว +3

      Big fan of your drawings and comics. 😍

  • @SubhraKDas-zg6jf
    @SubhraKDas-zg6jf 4 ปีที่แล้ว +1

    Such a graceful explanation.

  • @abrahakahsay
    @abrahakahsay 2 ปีที่แล้ว

    Liked and subscribed! Now, you are on my list for more references. Thanks, man.

  • @varisumrania
    @varisumrania 2 ปีที่แล้ว

    great videos with proper information. You r doing great work!! . Thanks for sharing ur knowledge nicely and clean .

  • @ranjanrnj6864
    @ranjanrnj6864 3 ปีที่แล้ว

    Thanks a lot Akshay, clear video of what I expected

  • @Aram64
    @Aram64 3 ปีที่แล้ว

    By far, the best explanation of prototype and __proto__. Thanks.

  • @pranshu_g
    @pranshu_g 3 ปีที่แล้ว +5

    Can't believe I finally understand this dunderproto thing 💯🔥.. I actually liked your video in between & then continued watching.

    • @akshaymarch7
      @akshaymarch7  3 ปีที่แล้ว +1

      Do watch Namaste Javascript web series on the channel, you'll love it brother. ❤️

  • @YashCurious
    @YashCurious 2 ปีที่แล้ว

    Thank you Bhaiya for explaining those terms beautifully, I'm glad that you made the video on it.

  • @rishavharsh6520
    @rishavharsh6520 4 หลายเดือนก่อน +7

    I am a Namste React subscriber and have completed the complete JS tutorials and I did not find this video over there , in the interview, protypal inheritancewas asked and I could not answer is correctly, so please add this video in the Namste JS section please, so that other will not face this issue.

  • @amiturfnd
    @amiturfnd 4 ปีที่แล้ว +1

    Mast, sab clear ho gaya. Thanks bro.

  • @ayikkathilkarthik4312
    @ayikkathilkarthik4312 3 ปีที่แล้ว

    Thank You so much, I surfed many other videos on same topic. But this one is the best, clears the whole concept. Subscribed the channel.
    Thank You.

  • @shresthsrivastava27
    @shresthsrivastava27 3 ปีที่แล้ว +2

    WOW ! :-D it's indeed an awesome explanation, got this concept cleared, thanks a lot bro :-)

  • @mdasadazam6161
    @mdasadazam6161 2 ปีที่แล้ว

    awesome video... cleared all my doubts without having to watch 100s of videos

  • @zarinamurattalks
    @zarinamurattalks ปีที่แล้ว

    Thank you Akshay! Your videos are helping me to understand things that I could not understand!

  • @jayeshbagul3961
    @jayeshbagul3961 10 หลายเดือนก่อน

    I am new on your channel and js too, but you are not disappointed me, thank you

  • @swayambhagwan
    @swayambhagwan 3 ปีที่แล้ว

    You are the best javascript tutor, i am watching all your videos.
    Great comtent, very helpful 😁

  • @piyu1919
    @piyu1919 4 ปีที่แล้ว +1

    YOU ARE A AMAZING TEACHER...PLS MAKE MORE VIDEOS

  • @dipinkrishnan
    @dipinkrishnan 3 ปีที่แล้ว

    Usual prototype expiation begin with car colour seat etc 🤦🏻‍♂️ and I forget every time ... Most simplest way to explain prototype and js inheritance. Love the way you detail things ..

  • @vinitrai5020
    @vinitrai5020 5 ปีที่แล้ว +10

    Hey Akshay, wonderful lesson. Thanks a lot for making it so simple.Your videos make JS easy and hence more interesting,as they say ''once you understand you get interested" .I would appreciate if you could come up with a video on DOM Manipulation without using Jquery.
    I know there are many resources available for this on the web but a video from your end will definitely clear the things in a much much better way.Hope to get a solid foundation video on DOM maipulation with Vanilla Javascript.
    Thanks in advance. :)

    • @akshaymarch7
      @akshaymarch7  5 ปีที่แล้ว +5

      Thanks for your suggestion, Vinit. That was not in my list, but even I think that would be helpful for a lot of people.
      Will surely try to cover that in upcoming videos. :)

  • @SiddhantKulshrestha
    @SiddhantKulshrestha 11 หลายเดือนก่อน

    Bhaisaab , I was so confused in this topic ... Akshay bhai ...Dil se shukriya ..❤

  • @gopalbharadva1390
    @gopalbharadva1390 2 ปีที่แล้ว

    Akshay your explanation is 1 number, I watched your video of poly fill for bind but don't understand the Function.prototype but now I got it. Thanks akshay bhai.

  • @deepankarsen4511
    @deepankarsen4511 4 ปีที่แล้ว +1

    Akshay bhai aapka samjhane ka tarika bohot gazab hain, thanks... : )

  • @ashirbadbehera5544
    @ashirbadbehera5544 4 ปีที่แล้ว +3

    THE BEST EXPLANATION....

  • @anitasunildesai
    @anitasunildesai 5 หลายเดือนก่อน

    Such complex concepts taught so beautifully with so much passion. Iam blessed to be your student watching and learning from your videos. No words to thank enough🙏🏼.

  • @danielgolden90
    @danielgolden90 2 ปีที่แล้ว

    Bravo. Great, simple, and clear explanation. Thank you.

  • @kirtisahai8745
    @kirtisahai8745 4 ปีที่แล้ว

    Your videos are amazing. I love them. Please make more.

  • @bw7891
    @bw7891 5 ปีที่แล้ว +1

    very good tutorial very useful. thank you Akshay.

  • @kodee2
    @kodee2 2 ปีที่แล้ว

    Came to this after being asked what is prototypical inheritance in JS during an interview and not REALLY knowing. Thanks!

  • @namankeshari7332
    @namankeshari7332 ปีที่แล้ว

    Your videos are actually making me understand javascript deeply!

  • @vijaykumar-wq9db
    @vijaykumar-wq9db 3 ปีที่แล้ว +1

    Great...Thank you...got my concept clear

  • @thespirtualhub
    @thespirtualhub 3 ปีที่แล้ว

    Your videos is really helpful. Thanks for this video.

  • @SoorajJose1
    @SoorajJose1 2 ปีที่แล้ว

    Finally i got what is Prototype and Prototypal Inheritance, thanks bro

  • @JS-zm5se
    @JS-zm5se 3 ปีที่แล้ว

    Keep posting amazing videos like this.

  • @prernasingh9186
    @prernasingh9186 3 ปีที่แล้ว +1

    Your explanation is just awsm.....Thankyou...

  • @armankabir8737
    @armankabir8737 2 ปีที่แล้ว

    Concepts clear within just 20 minutes, in which i was struggling for days. Thanks vaiya. Love from Bangladesh.

  • @ssvideos-web
    @ssvideos-web 3 ปีที่แล้ว

    Wanted to know what is prototype in JS... searched on youtube and here comes this first video in search, and no need to open other tabs from results... Guaranteed that everything will be covered here. Thank you 🙏🏼 for such great videos.

  • @kaleemelahishaikh7990
    @kaleemelahishaikh7990 3 ปีที่แล้ว

    Very helpful dude 🎉 Thanks for sharing your knowledge 👍🏻

  • @ankitpandey349
    @ankitpandey349 2 ปีที่แล้ว

    hatss off to u bro, u make hard concpet so easy to understand, u also made ur map reduce and filter video so much simple and elegant, keep posting more such😇😇😇

  • @moviecentral4225
    @moviecentral4225 4 ปีที่แล้ว +2

    I was looking this kind of explanation and i found.

  • @santhoshn31
    @santhoshn31 3 ปีที่แล้ว

    Thank you for sharing this video. I learned a lot from it.

  • @SrinubabuRavilla
    @SrinubabuRavilla ปีที่แล้ว

    That's a great explanation Akshay

  • @dequan300
    @dequan300 ปีที่แล้ว

    Great watch and great explanation of inheritance in js

  • @sachikanahashimoto710
    @sachikanahashimoto710 ปีที่แล้ว

    great concise nd clear explanation.Thankyou so much👍😀

  • @XYZ-bz8tf
    @XYZ-bz8tf 2 ปีที่แล้ว +1

    Yesterday I wasted my 3-4 hours on this topic with some videos on TH-cam. However, I did not fully understand the subject, there was always a missing piece. I could implement but this was just usage without understanding fully. Now, in 20 minutes, the subject has become completely clear in my head without any doubt. There is a serious amount of information pollution on the Internet.
    You really did a great job Akshay. I will be watching all your javascript-related videos for the next 2-3 days. Thank you so much for good and precise information.

  • @amrishpatidar2579
    @amrishpatidar2579 3 ปีที่แล้ว

    i learned many great things from you .thanks

  • @fatimaiqra2169
    @fatimaiqra2169 2 หลายเดือนก่อน +1

    u explained very well, thanks a lot!

  • @Manish-ee8kx
    @Manish-ee8kx 2 ปีที่แล้ว

    very clear explanation i watched many videos but this video is very understandable.

  • @saurabhagrawal3934
    @saurabhagrawal3934 3 ปีที่แล้ว

    thumbs up to the free tutorials in the world of wolf gupta

  • @hanmantjankar7544
    @hanmantjankar7544 2 ปีที่แล้ว

    You made this very easy to understand. Thank you!!!

  • @AdityaSingh-hx1tv
    @AdityaSingh-hx1tv 3 ปีที่แล้ว

    Finally a video that cleared my confusion 🙂🙂

  • @sreerup_dhrino
    @sreerup_dhrino 4 ปีที่แล้ว

    Simply loved it ❤️

  • @fake_captain
    @fake_captain 4 ปีที่แล้ว +1

    Thank you so much ..It was really helpful..

  • @learnuiwithmuzammil6907
    @learnuiwithmuzammil6907 3 ปีที่แล้ว

    Very nice explanation Akshay Sir...

  • @chetanmohol8850
    @chetanmohol8850 3 ปีที่แล้ว

    You are really good in JavaScript.. thanks for this video

  • @diwakaryadav4853
    @diwakaryadav4853 5 ปีที่แล้ว +1

    i like ur video and ur javascript knowledge is great ...please make more video on javascript.....there are less video on javascript....my concept on prototype inheritance is clear by watching your video

  • @TheUltimateTrainJourney
    @TheUltimateTrainJourney 4 ปีที่แล้ว +2

    Wonderful last 13 years working in JavaScript still was confused

  • @kysivaram
    @kysivaram 2 ปีที่แล้ว +1

    The best explanation on js prototype 👌🏻👌🏻

  • @himanshuaggarwal8415
    @himanshuaggarwal8415 2 ปีที่แล้ว

    Thanks a lot man, for such great lesson.

  • @rajapavithraselvaraj5937
    @rajapavithraselvaraj5937 3 ปีที่แล้ว

    Hi, Your videos and explanation are awesome. If you could mention timestamp to the topics in video's description it would be great. Keep Spreading the Knowledge

  • @adityatiwari1937
    @adityatiwari1937 2 ปีที่แล้ว +1

    Thank you for putting me in the example.... :)

  • @oqant0424
    @oqant0424 9 หลายเดือนก่อน +1

    Liked the video .......
    Got a clear understanding of the topic
    thanks❤❤

  • @ruicsf
    @ruicsf ปีที่แล้ว

    Nicely done! Thank you!

  • @aroundtheglobeSwati
    @aroundtheglobeSwati 3 ปีที่แล้ว +1

    Namaste JS has brought me here! :) Very informative video.. :)