Prototype vs __proto__ Javascript interview question

Publié le: 05 octobre 2023
sur la chaîne: code savera
705
12

Prototype is only accessible on constructors, while dunder proto is only accessible on instances.

"The function 'Person' on the screen is a constructor function that has a 'fullName' method defined on its prototype."

"When creating an instance, 'person1,' the prototype of the 'Person' constructor becomes linked to the dunder proto of the 'person1' instance."
//run the code

"And because of this linkage, we can now access the 'fullName' method of the constructor's prototype from the 'person1' instance."


Sur cette page du site, vous pouvez voir la vidéo en ligne Prototype vs __proto__ Javascript interview question durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur code savera 05 octobre 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 705 fois et il a aimé 12 téléspectateurs. Bon visionnage!