title: How to iterate over all but the last index of an AbstractArray
body: <p>In Julia, the recommended way to iterate over all indices of an <code>AbstractArray</code> is to use <code>eachindex</code>, e.g.,</p>
  
  <pre><code>for i in eachindex(a)
      do_something(a[i], i)
  end
  </code></pre>
  
  <p>In contrast to <code>1:length(a)</code>, <code>eachindex(a)</code> supports arrays with unconventional indexing, i.e., indices not starting at <code>1</code>. Additionally, it is more efficient for arrays with slow linear indexing.</p>
  
  <p>If I want to skip the first index I can use <code>Iterators.drop(eachindex(a), 1)</code> (is there a better way?) but how do I skip the last one in a generic way?</p>