var a = new String("123");
var b = "123";
alert(a === b); // returns false !! (but they are equal and of the same type)
Saw this in one of the answers.
a
and b
are not really the same type in this case, if you will check typeof(a)
you will get 'object' and typeof(b)
is 'string'.