Let’s think about the function signature in different (statically typed) languages. Remember, the compile breaks out of the function when return method is called, and nothing after it is run. The function defines a return type, and to a naive programmer looking at the signature it seems that one can only return a single thing. And it’s true- you can only return one thing. But, that thing can be an Object or an Array.
To return multiple values from a method, put the values in an array or object
(or similar data structure) and return that.
Even in languages where you don’t specify the return type, the method still ends as soon as you call the return statement, and you are only able to return a sinlge object.
Sorry to anyone who feels like they got cheeseballed because they were expecting a deep, complicated programming lesson and read a post about something totally obvious. I’m just making sure I don’t forget it! :)