O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Returning from a Function

The return statement ends execution of the current function. It has two forms:

return;

and:

return expression;

The first form (without an expression) is equivalent to:

return "";

Executing a return statement stops the current function immediately and returns the value of expression to the statement containing the function call. For example, you can check for an error condition at the top of a function and return invalid:

if (x < 0)
    return invalid;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required