Get the constructor of a string:
let message = "Hello World!";
let text = message.constructor;
The constructor
property returns the function that created the String prototype.
For JavaScript strings the constructor
returns:
function String() { [native code] }
Syntax Return Value function String() { [native code] } Browser Supportconstructor
is an ECMAScript1 (JavaScript 1997) feature.
It is supported in all browsers:
Chrome Edge Firefox Safari Opera IE Yes Yes Yes Yes Yes YesTrack your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4