return

Syntax

return <expression>

Details

Terminate the execution of a function and return the result. A return statement can only be used in function definition.

Examples

def f(a, b) {c=a*2+b pow 2; return a+c};
f(1,2);
// output
7