About 446,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. 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 …

  3. javascript - Functions that return a function: what is the …

    the statement 'return b();' means to execute a function named 'b' and then return what function 'b' return. but 'b' returns nothing, then this statement 'return b()' returns nothing either. If b() return …

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

  5. JavaScript Return Statements - freeCodeCamp.org

    Jan 21, 2020 · Functions can return: Never return something on a new line without using parentheses. This is a JavaScript quirk and the result will be undefined. Try to always use …

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

  7. JavaScript return - function return values - ZetCode

    Apr 16, 2025 · In this article we show how to use the return keyword to return values from functions in JavaScript. The return keyword is used to specify the value that a function should …

  8. How to Return a Value in JavaScript - ThoughtCo

    May 6, 2025 · 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. That value can be a …

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

    Sep 3, 2023 · In this comprehensive guide, we’ll explore the ins and outs of returning values from JavaScript functions, including the return statement, multiple return values, and best practices. …

  10. The Return Statement in JavaScript: Why it Matters

    While many functions you will write use the return statement, it's important to note that not all functions require it. The usage of return depends on the purpose of the function. This concept …

Refresh