JavaScript String constructor property
- Previous Page concat()
- Next Page endsWith()
- Go to the Previous Level JavaScript String Reference Manual
Definition and usage
constructor
properties return 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 an ECMAScript1 (ES1) feature.
All browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page concat()
- Next Page endsWith()
- Go to the Previous Level JavaScript String Reference Manual