title: Can i use constructor.name to detect types in JavaScript
body: <p>Can I use the &quot;constructor&quot; property to detect types in JavaScript?
  Or is there something I should know about it.</p>
  <p>For example: <code>var a = {}; a.constructor.name; // outputs &quot;Object&quot;</code></p>
  <p>or <code>var b = 1; b.constructor.name; // outputs &quot;Number&quot;</code></p>
  <p>or <code>var d = new Date(); d.constructor.name; // outputs &quot;Date&quot; not Object</code></p>
  <p>or <code>var f = new Function(); f.constructor.name; // outputs &quot;Function&quot; not Object</code></p>
  <p>only if use it on arguments <code>arguments.constructor.name; //outputs Object like first example</code></p>
  <p>I see quite often developers using: <code>Object.prototype.toString.call([])</code> or</p>
  <p><code>Object.prototype.toString.call({})</code></p>