0

I want to run all methods in a class dynamically so that when I add a method it would run too without explicitly invoking.

Is there any way of doing this in Javascript? I want to make an exetendable code where I would just add a method and don't have to care about invoking it.

Something like below could be done?

for (const func of new MyClass().allMethods) {
  func();
}
Guest-01
  • 587
  • 1
  • 4
  • 18

0 Answers0