title: Swift - How to get indexes of filtered items of array
body: <pre><code>let items: [String] = ["A", "B", "A", "C", "A", "D"]
  
  items.whatFunction("A") // -&gt; [0, 2, 4]
  items.whatFunction("B") // -&gt; [1]
  </code></pre>
  
  <p>Does Swift 3 support a function like <code>whatFunction(_: Element)</code>?</p>
  
  <p>If not, what is the most efficient logic?</p>