About 244,000 results
Open links in new tab
  1. How to return values in javascript - Stack Overflow

    Feb 23, 2017 · A much better alternative is to write the function so that values that are used by the function are passed to it as parameters and the function returns whatever value that it needs …

  2. Return multiple values in JavaScript? - Stack Overflow

    Apr 17, 2020 · as other answers said (and comments implied), ES6 brings a few options here. 3 to be exact: (1) object property shorthand return {dCodes, dCodes2} work just the same as …

  3. javascript - How to return values from async functions using async ...

    Apr 20, 2018 · async function callAsync() { var x = await getData(); console.log(x); } callAsync(); (I named the function for sake of clarity, but in this scenario, one would rather use an …

  4. javascript - Functions that return a function: what is the difference ...

    Imagine the function as a type, like an int. You can return ints in a function. You can return functions too, they are object of type "function". Now the syntax problem: because functions …

  5. JavaScript: How do I return two values from a function and call …

    Mar 14, 2015 · JavaScript: function getValue(){ var num1 = document.getElementById("firstNum").value; var num2 = …

  6. assign function return value to some variable using javascript

    Oct 8, 2018 · var response = (function() { var a; // calculate a return a; })(); In this case, the response variable receives the return value of the function. The function executes …

  7. JavaScript: function returning an object - Stack Overflow

    As a result of the call, the function can return a value. var player = makeGamePlayer("John Smith", 15, 3); The code above calls function makeGamePlayer and stores the returned value …

  8. How to use a return value in another function in Javascript?

    Jul 12, 2017 · I'm self-teaching myself JavaScript and out of curiosity I'm wondering what is the proper way of returning a value from one function to be used in another function. For example: …

  9. Return multiple variables from a JavaScript function?

    Apr 19, 2012 · Python can only return one value as well. JavaScript doesn't have a tuple-type so Objects (e.g. dict) or Arrays (e.g. list) can be used as a replacement. Also JavaScript doesn't …

  10. javascript - Return array from function - Stack Overflow

    Sep 14, 2016 · I'm writing a game in javascript, and I want to keep the files for matching block IDs to files in a seperate .js file from the map compiler, so that I can edit things easily. However, …

Refresh