get the prototype object of a class.
this is useful when you want to access bound-methods of an instance of a class, such as the ones declared as: class X { methodOfProto(){ } }.
these bound methods are not available via destructure of an instance, because they then lose their this context.
the only functions that can be destructured without losing their this context are the ones declared via assignment: class X { fn = () => { }, fn2 = function(){ } }
get the prototype object of a class.
this is useful when you want to access bound-methods of an instance of a class, such as the ones declared as:
class X { methodOfProto(){ } }
.these bound methods are not available via destructure of an instance, because they then lose their
this
context.the only functions that can be destructured without losing their
this
context are the ones declared via assignment:class X { fn = () => { }, fn2 = function(){ } }
Example