Return 2 results from method call?


#1

How could you return 2 results of a method call? Eg:

myMethod: function() { var car1 = 'blue'; var car2 = 'red'; return car1+car2; }

Something like that lol


#2

You probably want to return an object.

myMethod: function(){
  return {
     car1: 'blue',
     car2: 'red'
  };
}

#3

Ah that works.