N-R > return

return

Syntax

return[expression];
return;

Arguments

expression A type, string, number, array, or object to evaluate and return as a value of the function. This argument is optional.

Description

Action; specifies the value returned by a function. When the return action is executed, the expression is evaluated and returned as a value of the function. The return action causes the function to stop executing. If the return statement is used alone, or if Flash does not encounter a return statement during the looping action, it returns null.

Player

Flash 5 or later.

Example

The following is an example of using return:

function sum(a, b, c){
return a + b + c;
}

See also

function