return multiple values in javascript

JavaScript
//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        
            
        
     function getNames() {
    // get names from the database or API
    let firstName = 'John',
        lastName = 'Doe';

    // return values
    return {
        firstName,
        lastName
    };
}function doubleEachElement(num1, num2) {
  return [num1 * 2, num2 * 2];
}
const [a, b] = doubleEachElement(68, 100);var values = getValues();
var first = values[0];
var second = values[1];
Source

Also in JavaScript: