Forum Discussion
Got the solution from Smartbear.
In JavaScript, store your functions in the arrays and call them using key values. Here is the example code:
function f(){
let dyn_functions = [];
dyn_functions['Test1'] = function (arg1, arg2) {
return arg1 - arg2
};
dyn_functions['Test2'] = function (arg1, arg2) {
return arg1 + arg2
};
// calling one of the functions
let result = dyn_functions['Test1'](1, 2);
// this works as well
let result2 = dyn_functions.Test2(1, 2);
Log.Message("")
}
Thanks everyone for looking into the issue.
Still did not get use case and thus the actual need and the principal difference of the suggested solution from just calling two functions from the third one (the wrapper)...
But the above is irrelevant as long as you are satisfied with the suggested approach.
Related Content
Recent Discussions
- 15 hours agovladd1