JavaScript String constructor property
- Föregående sida concat()
- Nästa sida endsWith()
- Åter till föregående nivå JavaScript String referenshandbok
Definition and usage
constructor
property returns the function that creates the string prototype.
For JavaScript strings, the constructor returns:
function String() { [native code] }
instance
Get the constructor of the string:
let message = "Hello World!"; let text = message.constructor;
syntax
string.constructor
return value
function String() { [native code] }
browser support
constructor
is ECMAScript1 (ES1) feature.
All web browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida concat()
- Nästa sida endsWith()
- Åter till föregående nivå JavaScript String referenshandbok