title: How to check if variable is String type
body: <p>I'm getting data with ajax, and the result can be either array of results or a string statement like "no results found". How can i tell whether i got any results or not? 
  i tried this approach:</p>
  
  <pre><code>if result == String
      do something
  </code></pre>
  
  <p>but its not working, just like</p>
  
  <pre><code>if typeof(result) == "string"
      do something
  </code></pre>
  
  <p>Is there any other function that can help me get the type of the variable? Or maybe i can test it for Array type, it would also be very helpful</p>