Hence the function prototype of a function in C is as below: There are following categories: Function with no argument and no return value : When a function has no arguments, it does not receive any data from the calling function. The return statement literally returns a value to wherever the function was called. But you can use various way to simulate returning multiple values. In addition to returning the specified value the return statement also acts as an instruction to exit from the function at that point. But we can return them in form of Array and Object. do in JavaScript? This post is a part 3 of ECMAScript 6 Complete Tutorial post series. You can use arrays and objects and use object/array destructuring assignment to get individual values. Functions often compute a return value. Active 5 years, 2 months ago. You have a bigger problem in there. Return an Array of Values. If ret-list has only one element, this … Example 2: Return multiple values from the function using the tuple. JavaScript | Return multiple values from function. In this tutorial, you'll learn how to return data from JavaScript Promise. For example, if we want to return a string as well as integer, it won't be possible using the 2nd approach. Note that the order we define those in const [age, name] = getDetails() matters. Following are different ways.