Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return more than 1 value from function js

//Function that returns multiple values - Using destructuring

function foobar(foo, bar) {
  return [foo, bar];
}

const [one, two] = foobar(1, 2);
 
PREVIOUS NEXT
Tagged: #return #function #js
ADD COMMENT
Topic
Name
8+9 =