In JavaScript, the constructor property returns the constructor function for an object.
In JavaScript, the constructor property returns the constructor function for an object.
The return value is a reference to the function:
For JavaScript strings the constructor property returns function String() { [native code] }
string.constructor
function String() { [native code] }
The constructor property returns the string's constructor function:
var str = "Hello World!"; console.log(str.constructor);