When used with the new keyword, instances from the String() constructor produce an actual complex object. You should avoid doing this (use literal/primitive numbers) due to the potential problems associated with the typeof operator. The typeof operator reports complex string objects as 'object' instead of the primitive label ('string') you might expect. Additionally, the literal/primitive value is just faster to write and is more concise.

String() Properties and Methods

The String object has the following properties and methods (not including inherited properties and methods):