Javascript: typeof and instanceof results contradicting?
<p>I am seeing contradicting results when doing typeof and instanceof on an object.</p>

<p>I have the following test page:</p>

<pre><code>&lt;html&gt;
    &lt;body&gt;
        &lt;object id="test" /&gt;
        &lt;script type="text/javascript"&gt;
            var foo = document.getElementById("test");
            console.log(typeof foo); // returns "function"
            console.log(foo instanceof Function); // returns false
            console.log(foo instanceof Object); // returns true
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>"typeof foo" is returning "function" but
"foo instanceof Function" is returning false. </p>

<p>This doesn't make sense to me. How can an object have a type be function but not be an instance of a function? Also, I expected "typeof foo" to return "object".</p>
