Prototype vs __proto__ Javascript interview question

Pubblicato il: 05 ottobre 2023
sul canale di: 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."


In questa pagina del sito puoi guardare il video online Prototype vs __proto__ Javascript interview question della durata di ore minuti seconda in buona qualità , che l'utente ha caricato code savera 05 ottobre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 705 volte e gli è piaciuto 12 spettatori. Buona visione!