About 30,100,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. How To Use Return in JavaScript? - GeeksforGeeks

    Feb 17, 2025 · In JavaScript, the return statement is used to specify the value that a function should produce when it is called. It helps in controlling the flow of execution and provides …

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

  6. JavaScript Return Statements - freeCodeCamp.org

    Jan 21, 2020 · When a function return s a value, the value can be assigned to a variable using the assignment operator (=). In the example below, the function returns the square of the …

  7. javascript - When to use return, and what happens to returned data ...

    Aug 25, 2011 · Return in a function is a way to pass back data from the function. Example: var test = 1+1; return test; var feedback = test(); //feedback would now contain the value 2 if …

  8. What does "return" do in Javascript? - Stack Overflow

    Jun 10, 2017 · Surprisingly enough it "returns" whatever is after it. So if you call the function like var f = test() and test() return a value then f will be that value. console.log() only prints …

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

    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 …

  10. JavaScript Return Statements – TheLinuxCode

    Dec 11, 2024 · Return statements are critical in JavaScript for functions to send data back to the caller. When executed, they stop function execution and return a value to the calling code. …

  11. Some results have been removed
Refresh