Return

Return[expr]
returns the value expr from a function.

Return[]
returns the value Null.

DetailsDetails

  • 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.
New in 1 | Last modified in 3
New to Mathematica? Find your learning path »
Have a question? Ask support »