Magic of Prototype in javascript | chai aur #javascript

preview_player
Показать описание
#javascript #hindi
Sara code yaha milta h

Discord pe yaha paaye jaate h:
Instagram pe yaha paaye jaate h:
Рекомендации по теме
Комментарии
Автор

Basically the summary of the video is :

1) If you want that a method should be accessible or present in all objects in javascript (for ex: arrays, strings, functions, etc) then you can set your own method in the top level Object (because everything is an object in javascript) by using | Object.prototype.{method name} = function(){} |, after doing this you will have the access of your {method.name} from all objects for ex: every array that you declare, every string that you declare and so on.

2) But lets say if you want a certain method that should be accessible only on a certain object ( for example : (this is used in the video) you want a trueLength(){this method returns the true length of an array by trimming all the whitespaces} method to accessed on all String declarations, then you can be like | String.prototype.trueLength = function(){ code that does trimming and return length } | and this will be accessible on all strings .

3) this keyword in javascript refers to the current context of who is calling . matlab this boleto jisne bulaya . example: if you say | "hemant ".trueLength() | then how will the trueLength() method knows that on whom it have to perform . so we use this in the trueLength() function definition so it will automatically take the context of by whom the method is callled, boleto jisne bulaya uska kaam

if any one feels that i have included some wrong info in this comment then feel free to reply about the same.

hemantsuthar
Автор

0:00 - 27:00 object and new oprater features
27:00 prototype

vikasvarma
Автор

shuru shuru m chize upr se jaari thi... fer ek bar bich m chhodke dubara se start kiya tb acche se smjh aagya.. Thank You Sir

pococopo
Автор

I never 'knew' what all happened underneath 'new'.
Mind blowing detailing explaiend.

thecalgarians
Автор

Thank you Hitesh Sir for this amazing explanation of prototypes. Covers everything right from prototypical inheritance to defining own prototype methods for various objects.
I love how you teach everything starting from old coding practices to how it has been evolved today.

For anyone learning JavaScript from scratch and aiming to become a software developer, this is the go-to series!!

shreyakolekar
Автор

This playlist is full of detailed information. It is better than alot of PAID courses out there.

Thank you Software Expert Hitesh Choudhary Sir!

bhaimohsin
Автор

I am an English major student pursuing MERN stack following my passion. You contents are so helpful to understand things in details and it's work behind the scene . Thank you so much. You are affecting many students like me. ❤

aksh
Автор

crystal and clear explanation of this context. this means ''jis ne v bulaya ho'. All thanks to Hitesh sir. 😊

itumandal
Автор

Mark my words, In coming years this video will be one of the reason of making this playlist best present JS playlist on YouTube.

-धन्यवाद हितेश

Vikram_Singh_CS
Автор

Best teaching style....jis ka mtlb this

prateek
Автор

@ 27:00 begins prototypal (inheritance)
!

DashinDanish
Автор

Sir, this is the first time I could understood about prototype. Thanks

avneetyadav
Автор

The portion where we added custom function to all objects was really cool

gmukdpq
Автор

For people who are coming from Kotlin or similar languages, prototype function is a extension function for existing classes

RaviYadav_Dev
Автор

Thank you @Hitesh Sir. ❤ esi tarah video aayenge aur aese js topic milte rahenge to js mai mastery sach mai krr jayenge.

shadikhusain
Автор

How easily you made me clear about new and this keyword with the prototype you really nailed it 🔥

Hitesh.
Автор

All my topics about functional constructor, new keyword, constructor function, prototypal inheritance and this keyword are crystal clear now . Great video Sir No paid courses teaches like you in depth . Thank you so much sir ❤❤❤

shoaibhasan
Автор

this prototype video is really amazing i learn so so much from this video specially jis tarah se aap ne samjaya. muje bohot lambe time se prototype samaj nhi aarha tha specially "this" and "new" key word but finally me acche se samaj gya thank you so so much sir. ❤❤❤ sir aap ese hi video bnate rhe.

Leo-gaming-le
Автор

Itna depth aaj tak kisi JavaScript course me nhi hai.

HeyIMSomnath
Автор

At first I didn't understand what he was trying to explain about the prototype but then I rewatched the whole video. After that everything became crystal clear. This is the best explanation of a prototype you can ever imagine.

kunalpandey
welcome to shbcf.ru