JavaScript String constructor
Example
let str = "Hello World!";
str.constructor // Returns function String() {[native code]}
Try it Yourself »
Definition and Usage
The constructor property returns the function that created the String prototype.
For JavaScript strings the constructor returns:
function String() { [native code] }
Browser Support
constructor is fully supported in all browsers:
| Chrome | IE | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
string.constructor
Technical Details
| Return Value: | function String() { [native code] } |
|---|---|
| JavaScript Version: | 1.1 |

