title: How to determine the type of a variable in Swift
body: <p>Is there a function to determine the variable type in Swift? I presume there might be something like like <code>type()</code> in Python.</p>
  
  <p>I'd like a way to judge if a variable is a Foundation object or C variable in Swift. Like NSString vs String, or NSArray vs array. So that I can log it out in console and see clearly what it is.</p>
  
  <p>For example, I would like to know the type inferred for the the first <code>array</code> below:</p>
  
  <pre><code>var array = [1,2,3]  // by default NSArray or array?
  var array:[Int] = [1,2,3]
  var array:NSArray = [1,2,3]
  var array:Array&lt;Any&gt; = [1,2,3]
  </code></pre>
  
  <p>I have seen answers for judging if a <em>given</em> variable is a kind of <em>given</em> type in <a href="https://stackoverflow.com/q/24091882/1114">this question</a>, but I'll say it's quite different from what I want to ask.</p>