Returning Statements

The return; and return <expr>; statements immediately stop the current function's execution and return the provided expression as the function's result. The variant without an expression returns a nil value from the function. If the function reaches its end without an explicit return, it returns a nil value implicitly.

let foo = fn() {
    // Returns the value 100 from the foo function.
    return 100;
};

let one_hundred = foo();

// Returns the value 200 from the script.
return one_hundred * 2;

Depending on the Ad Astra specialization, the value returned from the script may represent the result of the script's execution.