title: How to access an element deep in an array of arrays without getting 'undefined method' error
body: <p>When trying to access an element deep in an array of arrays, what is the best way to avoid getting the error 'undefined method `[]' for nil:NilClass' if an element doesn't exist?</p>
  
  <p>For example I'm currently doing this, but it seems bad to me:</p>
  
  <pre><code>if @foursquare['response']['groups'][0].present? &amp;&amp; @foursquare['response']['groups'][0]['items'].present?
  </code></pre>