A constructor returns a reference to the string function that created the instance's prototype.
Its syntax is as follows −
string.constructor
Returns the function that created this object's instance.
<html> <head> <title>JavaScript String constructor Method</title> </head> <body> <script type="text/javascript"> var str = new String( "This is string" ); document.write("str.constructor is:" + str.constructor); </script> </body> </html>
str.constructor is: function String() { [native code] }