Need answers to few javascript questions?
<p><a href="http://stackoverflow.com/questions/1684917/what-questions-should-a-javascript-programmer-be-able-to-answer">What questions should a JavaScript programmer be able to answer?</a></p>

<p>I need few answers to the questions posted here?.</p>

<p><strong>I'm iterating through this array I defined, it has 3 elements in it.. the numbers 1 2 and 3.. Why on earth is jack showing up?</strong></p>

<pre><code>Object.prototype.jack = {};

var a = [1,2,3];

for ( var number in a ) {
    alert( number )
}
</code></pre>

<p><strong>Why does it alert undefined when I declared the jack variable to be 'Jack'?</strong></p>

<pre><code>&lt;script&gt;
    (function() {
        var jack = 'Jack';
    })();
    alert(typeof jack)
&lt;/script&gt;
</code></pre>

<p><strong>Why does it say object and not array? How would I detect if its an array?</strong></p>

<pre><code>array = [1,2]; alert( typeof array )
</code></pre>

<p><strong>I have two strings, but the second evaluation doesn't become true. Is this a potential bug? How come it's not true?</strong></p>

<pre><code>alert( [typeof 'hi' === 'string', typeof new String('hi') === 'string' ]  )
</code></pre>
