Taken from MDN
String literals (denoted by double or single quotes) and strings returned from String calls in a non-constructor context (i.e., witho
String Literal:
String literals are immutable, which means, once they are created, their state can't be changed, which also makes them thread safe.
var a = 's';
var b = 's';
a==b
result will be 'true' both string refer's same object.
String Object:
Here, two different objects are created, and they have different references:
var a = new String("s");
var b = new String("s");
a==b
result will be false, because they have different references.