Say I have the following broken example function in a google-apps script. The function is intended to be called from a google sheet with a string argument:
function myFunction(input) {
var caps = input.toUpperCase()
var output = caps.substrin(1, 4)
return output
}
While this example script should break on line 3 when you select myFunction and press debug, as there is no such method as substrin(), it will break on line 2, because you can't put undefined in all caps:
TypeError: Cannot call method toUpperCase of undefined. (line 2,
file Code)
Question:
Is there an official way to pass a string to a google-apps script for testing/debugging without making an additional function
function myOtherFunction() {
myFunction(testString)
}
and debugging that?