I have a really big urge to do something like this:
class A {
constructor(){}
age() { return 15; }
}
class B {
constructor() {
this.a = new A();
// DO SOMETHING THAT THIS IS POSSIBLE:
}
}
B b = new B();
b.age();
How to expose the method as if it was object b
's own method? I need to do this for every method of a property, regardless of number and name.
NOTE: I can't use inheritance.