I have this simple example that works
const func1 = function (i) { return (i) }
const func2 = function (i) { return (i * 2) }
const func3 = function (i) { return (i * 3) }
const func4 = function (i) { return (i * 4) }
const funcs = ['func1', 'func2', 'func3', 'func4']
function myFunction() {
let item = 3
let i = 2
let result = eval(`${funcs[item]}(${i})`)
console.log(result)
// what about call_user_func in google app script
}
Since eval() is not recommended, what will be the google app script equivalent of call_user_func (php)?