title: How to get index of an item in a array?
body: <p>What is the most efficient way to get the index of an item in array? In Objective-C we used to be able to do: </p>
  
  <pre><code>[arrayName indexOfObject:myObject]
  </code></pre>
  
  <p>in Swift, I know we can do the following. </p>
  
  <pre><code>index =arrayName.indexOf({$0 === myObject})
  </code></pre>
  
  <p>is this the cleanest and most efficient way to do it? </p>