The global String function converts a value to a string primitive when called without new. With new, it returns a String object wrapper. It is Baseline Widely available.
Pass the required arguments shown below. Prefer String(value) for coercion; avoid new String() unless you need an object wrapper.
Syntax
Create or coerce a string. Start with this line.
JavaScript
String(value) / new String(value)
Call
What it does
String(value) / new String(value)
Primary signature.
Built into JavaScript. Call String(...) (prefer without new) — no import required.
No auto-unbox for ===. A String object is not strictly equal to "hi".
Primitives compare cleanly.String("hi") === "hi" is true.
Escape hatch..valueOf() or String(wrapped) extracts the primitive.
Best fix. Do not create String objects — stay with literals and String(x).
Compatibility
Browser & Runtime Support
The String constructor is Baseline Widely available and supported in every modern browser and Node.js.
✓ Baseline · Widely available
String() constructor
Safe for production everywhere. Prefer String(value) for conversion; avoid new String().
100%Universal support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
String()Excellent
Bottom line: Use String(value) to coerce to a primitive. Avoid new String(). Use String(sym) when you must stringify a Symbol.
Frequently Asked Questions
String is a built-in global. Call String(value) without new to coerce value to a string primitive. Call new String(value) to wrap that text in a String object — rarely needed in everyday code.
String("hi") returns the primitive "hi" (typeof "string"). new String("hi") returns a String object (typeof "object"). Prefer the function form; MDN warns you should rarely use String as a constructor.
Strict equality compares type and value. A String object and a string primitive are different types even when their text matches. Prefer String(value) or string literals so you stay with primitives.
Yes. String(Symbol("x")) returns "Symbol(x)". Template literals, + concatenation, and "".concat(symbol) throw TypeError, so String() is the safe explicit path.
String() with no argument returns an empty string "". String(undefined) returns "undefined". String(null) returns "null". Objects use their toString() result (often "[object Object]").
String has been part of JavaScript since early editions. It is Baseline Widely available in every modern browser and Node.js.