JavaScript: 'foo' or foo {0="f", 1="o", 2="o"}`
<p>I have two fiddles that apply the code below, the only difference being that one uses console.log while the other uses alert to show the value of the variable myString. One fiddle alerts the string 'foo' while the other logs foo like this  <code>foo {0="f", 1="o", 2="o"}</code>  What accounts for this difference? </p>

<pre><code>    var myString = new String('foo'); // produces a String() object

   alert(myString);​
</code></pre>

<p><a href="http://jsfiddle.net/mjmitche/UdYXZ/" rel="nofollow">http://jsfiddle.net/mjmitche/UdYXZ/</a></p>

<p><a href="http://jsfiddle.net/javascriptenlightenment/XcfC5/" rel="nofollow">http://jsfiddle.net/javascriptenlightenment/XcfC5/</a></p>
