Hey gang, in this object oriented JavaScript video, we’ll be looking at the prototype object and how we can use it to give our objects methods.
π±βπ» Course Links:
– VS Code editor – https://code.visualstudio.com/
– GitHub repository (course files) – https://github.com/iamshaunjp/object-oriented-js
– JavaScript for Beginners – https://www.youtube.com/watch?v=qoSksQ4s_hg&list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET
π€ Donate @ https://www.paypal.me/thenetninja
πFind me on Udemy @ https://www.udemy.com/user/47fd83f6-5e4a-4e87-a0f0-519ac51f91b6/
πΎ Video thumbnail artwork by PixelSwish @ https://www.youtube.com/channel/UCGKSD3mitWl5UpMxZzaIrRA
Original source
24 responses to “Object Oriented JavaScript Tutorial #10 – Prototype”
#programming
thanks!
After so many tutorials and online courses I've finally understand the OOJ especially prototypes! Which means, the netninja is the best teacher on YouTube!
Thank you very much!
Thanks mate for your explanations from France π«π· !
Excellent description
very nice explanation.
Thanks Ninja
Boy, I've looked at lots of videos and this is the best.
The best explanation of prototypes. Thanks a lot.
Why should we use prototype instead of just including the function within the User function as that also worked? What are the advantages of doing this?
very clearly ! thank you !
could we put:
user.__proto__.login = function(){…}
?
https://hackernoon.com/prototypes-in-javascript-5bba2990e04b to dig deeper.
Great tutorial, thank you very much!
I have one question: why don't you create an object for the User.prototype like User.prototype = { login(){…}, logout(){…}} ?
very precise and understandable explanations. Thank you
Better way to define custom prototype:
User.prototype = {
login(){
this.online = true;
console.log(this.email, 'has logged in');
},
logout(){
this.online = false;
console.log(this.email, 'has logged out');
}
}
Hi i have finished your OOP please if you know of any start ups that can use a rockie i would like to join. I am Nelson From nairobi Kenya
Hey shaun your videos are amazing… Can you teach us about tensorflow.js only js expert can teach us
Why we cannot use 'arrow function' on creating prototype? anyone?
i try to use like this but, but seem like they don't recognize 'this' keyword? (return undefined)
User.prototype.login = () => {
this.online = true;
console.log(this.email, 'has logged in');
}
Really excellent!
Salut le Monde π
Merci beaucoup π
Wow, this is awesome! Thanks Ninja
Two simultaneously notification ~ ninja videos.
Thanks bro
Please do more on javascript programmings..
Hey netninja, where are part 1 ~10 ?