Return multiple values in JavaScript?

I am trying to return two values in JavaScript. Is this possible? var newCodes = function() { var dCodes = fg.codecsCodes.rs; var dCodes2 = fg.codecsCodes2.rs; return dCodes, dCodes2; }; 20 s 20 No, but you could return an array containing your values: function getValues() { return [getFirstValue(), getSecondValue()]; } Then you can access them like … Read more