About 174,000 results
Open links in new tab
  1. return - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · The return statement ends function execution and specifies a value to be returned to the function caller.

  2. JavaScript return Statement - W3Schools

    The return statement stops the execution of a function and returns a value. Read our JavaScript Tutorial to learn all you need to know about functions. Start with the introduction chapter about JavaScript Functions and JavaScript Scope.

  3. JavaScript Return Statement - GeeksforGeeks

    Feb 7, 2025 · The return statement in JavaScript is used to end the execution of a function and return a value to the caller. It is used to control function behaviour and optimise code execution. Syntax. Expression Evaluation: The expression inside the …

  4. How to return values in javascript - Stack Overflow

    Feb 23, 2017 · You can return an array, an object literal, or an object of a type you created that encapsulates the returned values. Then you can pass in the array, object literal, or custom object into a method to disseminate the values.

  5. The return keyword - web.dev

    Mar 31, 2024 · Use return to specify the value that the function should produce as a final result. When the interpreter reaches a return statement, the function that contains that statement immediately ends, and the specified value is returned to …

  6. JavaScript Return Statements - freeCodeCamp.org

    Jan 21, 2020 · When a return statement is called in a function, the execution of this function is stopped. If specified, a given value is returned to the function caller. If the expression is omitted, undefined is returned instead. return expression; Functions can return: Primitive values (string, number, boolean, etc.) Object types (arrays, objects ...

  7. JavaScript return Statement (With Examples) - Tpoint Tech

    Apr 2, 2025 · We can return primitive values (such as Boolean, number, string, etc.) and Object types (such as functions, objects, arrays, etc.) by using the return statement. We can also return multiple values using the return statement. It cannot be done directly. We have to use an Array or Object to return multiple values from a function.

  8. JavaScript return - function return values - ZetCode

    Apr 16, 2025 · The return keyword is used to specify the value that a function should return when it is called. When JavaScript encounters a return statement, it immediately exits the function and returns the specified value to the caller.

  9. Return Statement - JS Quick Tips: Master JavaScript with Easy-to …

    The return statement in JavaScript is a fundamental concept that allows a function to output a value back to the caller. It is an essential part of function execution and control flow, enabling developers to create more modular and reusable code.

  10. JavaScript Return Statements – TheLinuxCode

    Dec 11, 2024 · The syntax of a return statement in JavaScript is: return expression; The return keyword is followed by any valid JavaScript expression. This expression gets evaluated and the resulting value is sent back from the function.

  11. Some results have been removed
Refresh