JavaScript constructor Property
Definition and Usage
The constructor property returns the function that created the String object.
Syntax
string
.constructor
Browser support





All major browsers support the constructor property
Example
Example
Return the function that created the String object:
var
txt
=
"
Hello World!
"
;
document
.
write
(
txt
.
constructor
)
;
Output of the above example:
function String() { [native code] }
Try it »
JavaScript String object