title: How do I fetch the last element of an array in Swift?
body: <p>I can do this:</p>
  
  <pre><code>var a = [1,5,7,9,22]
  a.count               // 5
  a[a.count - 1]        // 22
  a[a.endIndex - 1]     // 22
  </code></pre>
  
  <p>but surely there's a prettier way?</p>