Is String a Primitive type or Object in Javascript? Source says Undefined, Null, Boolean, Number and String are all primitive types in Javascript. But it says String is an O
var a = "string"; typeof a // yields "string" var a = new String('string'); typeof a // yields "object"