title: How to get specific value within an array of arrays
body: <p>I have an array (outside array) that contains three arrays (inside arrays), each of which have three elements.</p>
  
  <pre><code>array = [[a, b, c], [d, e, f], [g, h, i]]
  </code></pre>
  
  <p>I want to select the specific inside array using an index of the outside array and then select the value within the selected inside array based off its index. Here is what I tried:</p>
  
  <pre><code>array.each_index{|i| puts "letter: #{array[i[3]]} " } 
  </code></pre>
  
  <p>I was hoping that would give me the following output</p>
  
  <pre><code>letter: c letter: f letter: i
  </code></pre>
  
  <p>but instead, I get</p>
  
  <pre><code>letter: [[a, b, c], [d, e, f], [g, h, i]]
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>array.each_index{|i| puts "letter: #{array[i][3]} " } 
  </code></pre>
  
  <p>but I get the same result. Please any suggestions are very appreciated. I need a simple explanation.</p>