How to get a return value from an ExtendScript

In my current uxp plugin project, I need to perform a specific operatation using ExtendScript. I can do this easily by app.doScript, but how can I get a return value? The documentation mentions app.scriptArgs, like in ExtendScript, but that property is obviously non-existant.
In a forum I found something about a script property in the uxp module, featuring an args object with similar functionality, but that is not documented and also non-existant, at least in my plugin.
But another post in this forum shows a way that works for me:

const indesign = require('indesign'),
    app = indesign.app;

const jsxCode = 
    "(function (args) { return 'hello ' + args[0]; })(arguments);";

const jsxResult = app.doScript(jsxCode, indesign.ScriptLanguage.JAVASCRIPT, [ 'world' ]);
// jsxResult === 'hello world'

I thought that what you got back was the result of the last line of your script. I’m only using it once but this is what I have…

:
:
javaScript_a.push(`header_s + '\\n' + xml_o.toXMLString();`);
var editedXML_s = g_app_o.doScript(javaScript_a.join('\n'), ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'snippetRemoveGroup');

True, thanks for pointing that out! So I can slightly simplify my example:

const indesign = require('indesign'),
    app = indesign.app;

const jsxCode = "'hello ' + arguments[0];";

const jsxResult = app.doScript(jsxCode, indesign.ScriptLanguage.JAVASCRIPT, [ 'world' ]);