return
Syntax
return()
return(value)
Return a value from a function.
A return()
marks the end of an execution path in a function:
foo() -> (
return(2);
print('x'); // not reachable
);
return()
is not needed when the returned value is the last expression in the
function:
foo() -> (
3
);
A return()
with no arguments returns null
.