The return statement is used to immediately return from the current function. It is illegal outside of the body of a function definition. If the function returns a value then the return statement must be accompanied by a return value of the correct type.