JavaScript Classes vs Prototypes

Publié le: 22 juillet 2019
sur la chaîne: Steve Griffith - Prof3ssorSt3v3
65,742
2.3k

This tutorial discusses the differences in syntax between creating objects in javascript with the class keyword or with the prototype methods.
Examples are given of doing the exact same things with both versions.
It is important to understand that the class syntax is being interpreted as using the prototype syntax and that CLASSES do NOT exist in JavaScript.

Completed Code GIST: https://gist.github.com/prof3ssorSt3v...

Code Note: line 50 should be
Object.setPrototypeOf(EmployeeP.prototype, PersonP.prototype); //extends
We are setting the prototype of EmployeeP's prototype to link to the prototype of PersonP.


Sur cette page du site, vous pouvez voir la vidéo en ligne JavaScript Classes vs Prototypes durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Steve Griffith - Prof3ssorSt3v3 22 juillet 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 65,742 fois et il a aimé 2.3 mille téléspectateurs. Bon visionnage!