title: Formatting of iterating over multi-dimensional arrays in Ruby
body: <p>I'm new to coding in Ruby, and I have a quick question about iterating over multi-dimensional arrays. I need to know what is appropriate in terms of formatting. This is my code for iterating over the array 'colors'</p>
  
  <pre><code>colors = [['red','orange'],['purple','blue'],['yellow','green']]
  colors.each{ |sub_arrays|
      sub_arrays.each{ |items|
          puts "#{items}"
      }
  }
  </code></pre>
  
  <p>This is the answer code</p>
  
  <pre><code>colors = [['red', 'orange'],['purple','blue'],['yellow','green']]
  
  colors.each do |sub_arrays|
  
  sub_arrays.each do |items|
      puts "#{items}"
  end
  end
  </code></pre>
  
  <p>I'm asking if this was just a mistake on the answer sheet or if this is actually how you're supposed to format this code. Also, is it better to use keywords 'do' and 'end' as supposed to curly brackets? And should I put the element |sub_arrays| or |items| on the same line as the .each method? Thanks!</p>