title: Ruby: how to know depth of multidemensional array
body: <p>This is my problem I have met in my assignment.</p>
  
  <ul>
  <li>Array A has two elements: array B and array C.</li>
  <li>Array B has two elements: array D and array E</li>
  <li>At some point, array X just contains two elements: string a and string b.</li>
  </ul>
  
  <p>I don't know how to determine how deep array A is. For example:</p>
  
  <pre><code>arrA = [
           [
             [1,2]
           ]
         ]
  </code></pre>
  
  <p>I have tested by: <code>A[0][0][0] == nil</code> which returns <code>false</code>. Moreover, <code>A[0][0]..[0] == nil</code> always returns <code>false</code>. So, I cannot do this way to know how deep array A is.</p>