
return - JavaScript - MDN
Jul 8, 2025 · The return statement ends function execution and specifies a value to be returned to the function caller.
Function return values - Learn web development | MDN
Aug 20, 2025 · It's important to understand what their values are, how to use them in your code, and how to make functions return useful values. We'll cover all of these below.
Statements and declarations - JavaScript - MDN
Jul 29, 2025 · Statements and declarations JavaScript applications consist of statements with an appropriate syntax. A single statement may span multiple lines. Multiple statements may occur on a …
Functions - JavaScript | MDN
Jul 8, 2025 · The function consists of one statement that says to return the parameter of the function (that is, number) multiplied by itself. The return statement specifies the value returned by the …
Functions - JavaScript | MDN
Jul 8, 2025 · The return statement allows you to return an arbitrary value from the function. One function call can only return one value, but you can simulate the effect of returning multiple values by …
Warning: unreachable code after return statement - MDN
Jul 8, 2025 · When an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is unreachable, meaning it can never be run.
SyntaxError: return not in function - JavaScript | MDN
Jul 8, 2025 · The JavaScript exception "return not in function" occurs when a return statement is called outside of a function.
function - JavaScript | MDN
Jul 8, 2025 · Each time when a function is called, it returns the value specified by the last executed return statement, or undefined if the end of the function body is reached.
Arrow function expressions - JavaScript | MDN
6 days ago · The braces can only be omitted if the function directly returns an expression. If the body has statements, the braces are required. In this case, return values must be explicitly specified with …
yield - JavaScript | MDN
Jul 8, 2025 · A return statement. In this case, execution of the generator ends, and the next() method returns an iterator result object where the value is the specified return value and done is true.