return

语法

return [expression]

详情

return 语句终止一个函数的执行并返回执行结果。

例子

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