This JavaScript Constructor property performs the same task as it does in the other objects that have it (like the Date and Array objects). . It sends back the value of the JavaScript Constructor function that created the String object’s prototype. To use the JavaScript Constructor property, you have to use a String object rather than a literal.
The following code writes the value of the JavaScript Constructor property onto a Web page:
<html> <body> <script type="text/javascript"> var guitar_string = new String("G"); document.write(guitar_string.constructor); </script> </body> </html> This code produces text similar to the following: function String() { [native code] }