title: Find the index of a certain value in array using swift
body: <p>Following the instructions reported in the documented swift manual
  <a href="http://swift-ios.co/standard-functions-in-swift/" rel="nofollow">http://swift-ios.co/standard-functions-in-swift/</a></p>
  
  <p>I found the code the extract the index of a certain value of an array using</p>
  
  <pre><code>var languages = ["Swift", "Objective-C"]
  find(languages, "Objective-C") == 1
  find(languages, "Java") == nil
  find([29, 85, 42, 96, 75], 42) == 2
  </code></pre>
  
  <p>The problem is that the output value doesn' t have the same type of the elements os the starting array, since the output in the console is (for the last line)</p>
  
  <pre><code>Optional(2)
  </code></pre>
  
  <p>What if I want to get the 2 as <code>Int</code> or <code>Double</code>?</p>