About 1,370,000 results
Open links in new tab
  1. 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 …

  2. How To Use Return in JavaScript? - GeeksforGeeks

    Feb 17, 2025 · The return statement in JavaScript is used to end a function execution and send a value back to where the function was called. It allows the function to provide useful results, like …

  3. return - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · In a plain function, the call to that function evaluates to the return value. In an async function, the produced promise is resolved with the returned value. In a generator …

  4. javascript - When should I use return? - Stack Overflow

    Jun 2, 2013 · You should use return if your function needs to, well, return anything to its caller. In your example, it's not necessary to use return because console.log already does what you …

  5. JavaScript return - function return values - ZetCode

    Apr 16, 2025 · JavaScript return keyword tutorial shows how to return values from functions in JavaScript. The tutorial provides numerous examples to demonstrate return values in JS …

  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 …

  7. JavaScript Tutorial => Using the Return Statement

    The return statement can be a useful way to create output for a function. The return statement is especially useful if you do not know in which context the function will be used yet. //An …

  8. 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 …

  9. How do I return a value from a JavaScript function? - James Parker

    Sep 3, 2023 · To make your functions truly dynamic and powerful, understanding how to return values from them is crucial. In this comprehensive guide, we’ll explore the ins and outs of …

  10. How to return values in javascript - Stack Overflow

    Feb 23, 2017 · JavaScript passes a value from a function back to the code that called it by using the return statement. The value to be returned is specified in the return keyword.

  11. Some results have been removed
Refresh