Good example, but i think for us beginners we would like to know when in a real life use case would we use prototypes and constructors i have created a couple of complex web apps and never needed to set a prototype or constructor, although i could probably benefit from it, problem is dont know when i need to use it
Good topic for a future tutorial. One rule that is important is don't repeat code, so if a certain functionality is being used in more than one place, put it on the prototype. You are correct you can do a lot of coding without using prototypal inheritance, but I would encourage looking for places you can use it. It will make your code cleaner and easier to manage and maintain.
Sir with ur tutorials is it possible to get a job, don't mind me but I m low on money can't afford udemy or udacity etc but ur courses are incredible, could u please advice?
By default ES6 classes assign methods to the prototype. It is a simple way to set up the prototype. Although I feel it obscures the true nature of what is going on. I talk about this a bit in my latest tutorial: th-cam.com/video/iYCT1dY42d8/w-d-xo.html
Method #1 has a dysfunctional prototype. It is missing a required constructor property. The better solution would be to just mutate the constructor functions existing prototype object. Greeting.prototype.greet = function() {...} Or you could add ... objProto.constructor = Greeting to objProto object.
NickD Hrones 虽然不懂你在说什么,但是感觉好强大的样子。Although I don't really understand what you are saying, but I feel it is great(My poor translation for that Chinese online saying expressing sort of awesome yet hard to understand).
I am reading a book, your solution is quite alike. The book is hard for me so I search the video tutorial but it turns out your reply is adding the help, thx. By the way, I am reading Secrets of the javascript ninjia, 2nd.
I am reading a book, your solution is quite alike. The book is hard for me so I search the video tutorial but it turns out your reply is adding the help, thx. By the way, I am reading Secrets of the javascript ninjia, 2nd.
Thank you for the time you took to make these tutorials. They are really helping me excel in my career
Good example, but i think for us beginners we would like to know when in a real life use case would we use prototypes and constructors i have created a couple of complex web apps and never needed to set a prototype or constructor, although i could probably benefit from it, problem is dont know when i need to use it
Good topic for a future tutorial. One rule that is important is don't repeat code, so if a certain functionality is being used in more than one place, put it on the prototype. You are correct you can do a lot of coding without using prototypal inheritance, but I would encourage looking for places you can use it. It will make your code cleaner and easier to manage and maintain.
@@AllThingsJavaScript Thanks, look forward to that tutorial on use cases.
What keyboard do you have, I like the sound.
Microsoft ergonomic 4000
more useful ..Thank you
Sir with ur tutorials is it possible to get a job, don't mind me but I m low on money can't afford udemy or udacity etc but ur courses are incredible, could u please advice?
Sure, you can learn JavaScript well enough to start working in. It will just take a bit more effort on your part.
All Things JavaScript, LLC I got it sir thank you very much, God bless u for helping us👍🏻
How about ES6 class functions?
By default ES6 classes assign methods to the prototype. It is a simple way to set up the prototype. Although I feel it obscures the true nature of what is going on. I talk about this a bit in my latest tutorial: th-cam.com/video/iYCT1dY42d8/w-d-xo.html
Method #1 has a dysfunctional prototype. It is missing a required constructor property.
The better solution would be to just mutate the constructor functions existing prototype object.
Greeting.prototype.greet = function() {...}
Or you could add ...
objProto.constructor = Greeting
to objProto object.
NickD Hrones 虽然不懂你在说什么,但是感觉好强大的样子。Although I don't really understand what you are saying, but I feel it is great(My poor translation for that Chinese online saying expressing sort of awesome yet hard to understand).
I am reading a book, your solution is quite alike. The book is hard for me so I search the video tutorial but it turns out your reply is adding the help, thx. By the way, I am reading Secrets of the javascript ninjia, 2nd.
I am reading a book, your solution is quite alike. The book is hard for me so I search the video tutorial but it turns out your reply is adding the help, thx. By the way, I am reading Secrets of the javascript ninjia, 2nd.
Nice..
{2021-09-23}