Prototype and Prototypal Inheritance in Javascript | Frontend Interview Question

Prototype and Prototypal Inheritance in Javascript | Frontend Interview Question

Akshay Saini

6 лет назад

425,728 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@oqant0424
@oqant0424 - 14.10.2023 11:41

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

Ответить
@hassamsaeed4839
@hassamsaeed4839 - 18.10.2023 17:24

Do you have a Stammering issue? I just feel it. Is it true?

Ответить
@surajmaurya1515
@surajmaurya1515 - 30.10.2023 07:23

Thank You Sir

Ответить
@avanishexplorer
@avanishexplorer - 30.10.2023 11:54

samjh nhi aya clearity nhi thi...

Ответить
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars - 31.10.2023 08:26

simple and to the point, thank you :)

Ответить
@porobertdev
@porobertdev - 30.11.2023 00:06

Thank you so much! 🙂

It was very clear. I was thinking that everything in JS is an object before watching this, but I was still confused a bit and had doubts about that. But you just confirmed that😊

So basically, everything in JS is an object. And each object has its own constructor (function that created it) with a prototype (another object) attached to it. And that prototype has another prototype attached to it, which is Object.prototype. And Object.prototype is the "parent of all", meaning that there's no more "nested" prototypes.

So we could say that everything starts from the Object constructor (function) ?

🚀

Ответить
@vikashvikash6346
@vikashvikash6346 - 13.12.2023 16:47

Object in JS be like : Aham brahmasmi 😌

Ответить
@msahu2595
@msahu2595 - 18.12.2023 11:52

Ответить
@AftabKhan-y6j
@AftabKhan-y6j - 30.12.2023 12:03

its not working for me

Ответить
@RaviTeja-gq5wm
@RaviTeja-gq5wm - 02.01.2024 19:45

Akshay Explanation is like: So Beautiful, So Elegant Looking Like a Wow. Really great explanation Akshay, its that simple. You have best teaching skills... Super👌👌👌

Ответить
@funguy29
@funguy29 - 18.01.2024 10:42

so everthing in JS is an object

Ответить
@VinodrajRaj-k7k
@VinodrajRaj-k7k - 18.01.2024 11:00

Explaination of prototype and prototypal inheritance topic is bit complex compare to your
other videos

Ответить
@divyanshu3725
@divyanshu3725 - 30.01.2024 08:19

EVERYTHING IN JAVASCRIPT IS AN OBJECT
and
EVERYTOPIC YOU EXPLAIN BECOMES CRYSTAL CLEAR

Thanks a ton for this detailed video 🙏

Ответить
@diwakardayal954
@diwakardayal954 - 31.01.2024 08:45

thanks

Ответить
@anitasunildesai
@anitasunildesai - 05.02.2024 19:42

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🙏🏼.

Ответить
@sohailmohammed4024
@sohailmohammed4024 - 14.02.2024 12:02

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

Ответить
@prateek2159
@prateek2159 - 29.02.2024 06:27

I found a much better and in depth explanation for this in an article on medium: Prototypal Object-Oriented Programming in Javascript by Prateek

Ответить
@rishavharsh6520
@rishavharsh6520 - 09.03.2024 17:52

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.

Ответить
@harshverma9675
@harshverma9675 - 17.03.2024 15:51

Do you know you are mentioned in T.O.P. ?

Ответить
@GrantH2606
@GrantH2606 - 25.03.2024 23:06

Would it be possible to have captions for those of us hard of hearing thankyou

Ответить
@vinothkumarv9722
@vinothkumarv9722 - 29.03.2024 20:42

Hi bro ,

just now also I revised :) --- love you Boy

Ответить
@hemantvardani1436
@hemantvardani1436 - 04.05.2024 19:31

Thanks , that was great video

Ответить
@Anila-g9z
@Anila-g9z - 11.05.2024 07:41

Ответить
@fatimaiqra2169
@fatimaiqra2169 - 12.05.2024 08:46

u explained very well, thanks a lot!

Ответить
@dharmaraosalana641
@dharmaraosalana641 - 24.05.2024 13:58

Appreciate if you include running notes and queries section in namastedev site

Ответить
@ItachiUchiha-ob8zy
@ItachiUchiha-ob8zy - 29.05.2024 11:06

you are saving in 2024 too

Ответить
@mishen-thakshana
@mishen-thakshana - 16.06.2024 14:58

Why performance issues? Here what I found by doing a research.
1. By directly modifying the _proto_ we increase the time for prototype lookups, which means it again goes for another _proto_ chain
2. Also JS engines like v8 optimized to lookup for a stable prototype chain so by modifying the _proto_ chain we are de-optimizing it

Ответить
@AnsuVarghese-e1i
@AnsuVarghese-e1i - 17.06.2024 16:34

Akshay plz create video on RxJS.

Ответить
@ishratkaur1605
@ishratkaur1605 - 10.07.2024 10:26

if using ._proto_ is not the correct way to inherit from another object, then what is the correct way ?

Ответить
@manisharajput4870
@manisharajput4870 - 28.07.2024 07:43

wow

Ответить
@abhisheksoni4254
@abhisheksoni4254 - 03.08.2024 20:26

No wonder why Akshay is the best when it comes to JavaScript, I have just watched half of the video, and today my this query "€verything in JS is an object" is resolved. Today I got the real answer. Thank you, Akshay ❤ ☺️

Ответить
@Kavinderchoudhary-i7n
@Kavinderchoudhary-i7n - 05.08.2024 17:24

What if we need freeze the object1 propery like name, it will not change but other properties get change

Ответить
@Max-he9hl
@Max-he9hl - 05.08.2024 23:50

Super great video Akshay! But why Array._proto_ would be same as Function.prototype ?? 🤔
But Function._proto_ is also Function.prototype 🤯🤯

Ответить
@sailaxmikomirineni5336
@sailaxmikomirineni5336 - 07.08.2024 13:15

Tq for replying akshay we are from the team Swami Vivekananda Indian Innovation Hub. Visit it when you visit hyd

Ответить
@Balkrishnajaybhaye
@Balkrishnajaybhaye - 03.09.2024 13:23

🙏

Ответить
@srinivasnahak3473
@srinivasnahak3473 - 23.09.2024 13:06

Thank you so much for indepth explanation.

Ответить
@amaltk1520
@amaltk1520 - 30.09.2024 19:08

it took too long for me to understand, your explanation is not straight forward, but it has the point

Ответить
@Biceps_7
@Biceps_7 - 08.10.2024 20:30

This is similar like making a class in c++ and when ever you create a object it create a constructure where you can also write functions or any code and its like similar when ever you make a object array and functions its create a object and it follows same constructure all of the funtion inside the construcute and each and every thing.

Ответить
@barathkumar4981
@barathkumar4981 - 01.11.2024 18:13

where to use this in realtime project.
will this act like global variable and consume more memory when i attach multiple functionprototype?
please assit

Ответить
@CodingFame-h4g
@CodingFame-h4g - 04.11.2024 05:30

Wow😮😮😮

Ответить
@RejetiMeghaVardhan
@RejetiMeghaVardhan - 11.11.2024 19:27

😀 You are an awesome teacher Akshay

Ответить
@tanushreeyadav745
@tanushreeyadav745 - 08.12.2024 10:48

Thank You

Ответить
@amoldeepgupta1400
@amoldeepgupta1400 - 14.12.2024 15:25

everything in js is not object

Ответить
@WebDevChronicles247
@WebDevChronicles247 - 17.12.2024 11:32

Hello @everyone @akshay i just want to know is Prototype and _proto_ are same ?

Please Correct me if I am wrong please provide me clarity in this. as per my understanding
Prototype and _proto_ are different : Only Functions has prototype which provide us a free space or we can say and empty object. It is an object automatically created when a function is declared. The prototype is used to define properties or methods that should be inherited by instances created using that function as a constructor.

_proto_ : This _proto_ points to the prototype object of the constructor function that created the object.

could you please Explain below example ?

function showData(){
console.log('hello');
}
if(showData.prototype){
console.log(showData.prototype); // in this case it will print the prototype.
} else {
console.log('Prototype is not present );
}

but in case of array or object it will not print

Ответить
@shimmy1003
@shimmy1003 - 25.02.2025 08:59

Even null is an object 😂

Ответить
@Rishabh-Dev06
@Rishabh-Dev06 - 27.03.2025 09:55

in simple to give property of your own to another is called prototype

Ответить
@zahebshamsi
@zahebshamsi - 30.03.2019 19:54

First i like your video then watch it. :P

Ответить