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 foo {0="f", 1="o", 2="o"}
What accounts for this difference?
var myString = new String('foo'); // produces a String() object
alert(myString);