Home >>JavaScript String Methods >JavaScript String constructor Property

JavaScript String constructor Property

What is JavaScript String constructor Property

JavaScript constructor property is used to return the constructor function for an object. The return value of this is a reference to the function and not the name of the function.



Browser Support

Method Chrome Edge Firefox Safari Opera
constructor Yes Yes Yes Yes Yes

Here is an example of constructor property:

<p id="demo"></p>
var str = "Hello World!";
document.getElementById("demo").innerHTML = str.constructor;
function String() { [native code] }