Use of toString() instead of constructor in JavaScript
<p>This is probably a stupid question, so please stick with me. </p>

<p>Why do I see so many examples testing whether an object is a Function by comparing its toString() to "[object Function]"? </p>

<p>For example: </p>

<pre><code>function isFunction(obj) {
    return Object.prototype.toString.call(obj) == "[object Function]";
}
</code></pre>

<p>Can't we use <code>instanceof Function</code> or <code>obj.constructor === Function</code>? Are those not cross-browser compatible?</p>

<p>This <em>seems</em> inefficient, but is it? Why?</p>
