What is a good singular way to check for types?
<p>One simple approach used in libraries such as backbone is:</p>

<pre><code>typeof o === type;
</code></pre>

<p>ES5 suggests using something similar to</p>

<pre><code>(Object.prototype.toString.call(o) === '[object ' + type + ']');
</code></pre>

<p>and Finally SO users have shared: ( <a href="http://codereview.stackexchange.com/questions/23317/improving-istypeobj-and-gettypeobj">code review on getType</a> )</p>

<pre><code>o.constructor === type;
</code></pre>

<p>Here are three fundamentally different ways</p>

<ul>
<li>using typeof</li>
<li>using toString</li>
<li>using the constructor property</li>
</ul>

<p>I'd like to use these 3 methods to write a general checkType method.</p>

<p>Any advice on how best to combine these logically or why there are so may different ways to go about it.</p>
