I'm doing some JS refresher on inheritance. Say initially I have this:
const a = function(x) {
this.x = x;
};
const b = function(x, y) {
this.y = y;
};
In the end if I have as below, that's I will get:
const newB = new b('x', 'y');
newB.getX(); // x
newB.getY(); // y
How do I go about this?