3 ms·
Returning an object from a function was not the problem - it was "returning" from a Script (as executed by the NodeJS Script class). So essentially the last val
by Tichy 16y ago
Returning an object from a function was not the problem - it was "returning" from a Script (as executed by the NodeJS Script class). So essentially the last value in the script, I suppose.
I like the ({x:1}) shortcut, thanks!
- points 16y agoI don't quite understand what you mean by 'returning from a script'. That doesn't make too much sense within Javascript itself, if it's a case of the last expression being considered the return value (I haven't used NodeJS), then you would want: doSomething(); ({x:1});
- tlrobinson 16y agoeval("{x:1}") // returns 1 eval("({x:1})") // returns {x:1}