title: How does Ruby return two values?
body: <p>Whenever I swap values in an array, I make sure I stored one of the values in a reference variable. But I found that Ruby can return two values as well as automatically swap two values. For example,</p>
  
  <pre><code>array = [1, 3, 5 , 6 ,7]
  array[0], array[1] = array[1] , array[0] #=&gt; [3, 1] 
  </code></pre>
  
  <p>I was wondering how Ruby does this.</p>