String Object : Constructor Property

January 3, 2025 No Comments » Hits : 243





String Object : Constructor Property

  • The constructor property returns the function that created the String object’s prototype.

Syntax :

string.constructor

Sample Script

<html>
<body>
<script type="text/javascript">
var txt = "Hello World!";
document.write(txt.constructor);
</script>
</body>
</html>

Output :

function String() { [native code] }

Supported Browsers :