O'Reilly logo

haXe 2 by Benjamin Dasnois

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

Return

The return keyword is used to exit from a function or to return a value from a function (and exit it).

function isAdult (age : Int) : Bool
{
if(age < 18)
{
return false;
}
return true;
}

This is a function that should help you understand how to use the return keyword. It returns false if the age is inferior to 18, or else it returns true.

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