I am looking for the best method of calling functions with variable names that all follow a specific rule. I am trying to avoid using eval() since there are so many problems about it online.
I have a system setup where different groups have a function that can be called based on their name EG Test group would have a function imported in called getValue_Test(params) and this function can be called for any group name EG getValue_Test2(params) would work if the group name was test2.
I have these functions being imported into the react component and just want to know the best way to call them without making giant switch statement since there will be hundreds of these functions.
Any help would be appreciated :) Thanks
getValue('test', params)and made the group a variable and not hardcoded, then you wouldn't have this xy problem