xxxxxxxxxx
//Function that returns multiple values - Using destructuring
function foobar(foo, bar) {
return [foo, bar];
}
const [one, two] = foobar(1, 2);
xxxxxxxxxx
//function that returns multiple values
function getTopTwoColors() {
return ["blue", "pink"];
}
var topTwoColors=getTopTwoColors();
var firstValue=topTwoColors[0]; //get first return value
var secondValue=topTwoColors[1]; //get second return value