Domanda di colloquio di LinkedIn

Prototype vs Private method of a class and this.method Create template using HTML and CSS without running code

Risposta di colloquio

Anonimo

9 lug 2018

A private method can be called a local method, usually those are found inside the constructor of the parent class and can only be accessed by privileged methods (example: this.method). They are not visible to prototypes of the parent class as their scope is limited to the parent. Prototype can be a copy or child inheriting all parent class's privileged methods.