title: Finding Variable Type in JavaScript
body: <p>In Java, you can use <code>instanceOf</code> or <code>getClass()</code> on a variable to find out its type.</p>
  
  <p>How do I find out a variable's type in JavaScript which isn't strongly-typed?</p>
  
  <p>For example, how do I know if the <code>bar</code> is a <code>Boolean</code> or a <code>Number</code>, or a <code>String</code>?</p>
  
  <pre><code>function foo(bar) {
      // what do I do here?
  }
  </code></pre>