This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Flow Control  /

  • Return[ expr ] returns the value expr from a function.
  • Return[ ] returns the value Null.
  • Return[ expr ] exits control structures within the definition of a function, and gives the value expr for the whole function.
  • Return takes effect as soon as it is evaluated, even if it appears inside other functions.
  • Return can be used inside functions like Scan.
  • See the Mathematica book: Section 2.5.9.
  • See also: Break, Throw, Abort.