JavaScript constructorProperty
Definition and Usage
The constructor property returns the function created for the String object property.
Syntax
string.constructor
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the constructor property.
Example
Example
Returns the function created for the String object property:
var txt = "Hello World!";
document.write(txt.constructor);
The above example outputs:
function String() { [native code] }
Try it Yourself »
Other Extensions
JavaScript String Object