I have a code like this;
function A(){}
Object.defineProperties(A.prototype,{
'propName' : {
'get' : function(){
return 'hallo';
},
'set' : function( p ){
console.log( 'setting...' );
}
}
});
function B(){
A.call( this )
}
B.prototype = Object.create( new A(), {
'propName' : {
'get' : function(){
//do something than call getter of parent prototype
},
'set' : function( p ){
//do something than call setter of parent prototype
},
}
});
Is it possible to call the prototype of a getter or setter, if yes, how?
Grettings….
Yes, it is possible.