new String(thing) String(thing)
- Anything to be converted to a string.
String function and String constructor produce different results:
typeof String('Hello world'); // string typeof new String('Hello world'); // object
Here, the function produces a string (the primitive type) as promised. However, the constructor produces an instance of the type String (an object wrapper) and that's why you rarely want to use the String constructor at all.
BCD tables only load in the browser