When presented with a class structure as demonstrated below, I am able to iterate through all its PropertyNames using console.log
.
class Security {
constructor(param: ParamType) {
this.method1(param);
...
this.methodN(param);
}
method1(param){...};
...
methodN(param){...};
}
Object.getOwnPropertyNames(Security.prototype).forEach( (value) => {
console.log('Method: ', value);
// value()?
});
My query is regarding how to trigger the execution of all methods instead of leaving them as placeholders in // value()?