Program Structure

Program Structure

Every script must contain the function
onResults
. This function takes one argument as a data structure and returns the structure.
The
onResults
function must be marked as export as in the following example:
export function onResults(inputResult) { }
In addition to the body of the main function, a script can have multiple helper functions, classes, global variables, and code before the
onResults
function.
If you have experience with JavaScript, view your script as a JavaScript library and follow the same principles. Understand when the code is initially loaded and executed and the exported functions are used by external code.