-
Pseudoclassical subclasses in Js are most optimised subclasses in Js
-
optimised as the prototypical methods are inherited by the new instances hence we optimised it by not creating a method in cunstructor everytime we call a custructor for new instance.
-
prototypical methods are not created everytime for every new instance or custructor call
-
prototypical methods are inherited for every new instance or custructor call.
-
as a nature of prototypes or can say Object.create(FourWheeler.prototype) every change in prototype obj is reflected to all the other instances created.
var FourWheeler = function(location){
this.location = location;