Easy Tutorial
❮ Jsref Tanh Dom Obj Week ❯

JavaScript constructor Property

JavaScript String Object


Definition and Usage

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

Syntax


Browser Support

All major browsers support the constructor property.


Example

Return the function that created the String object's prototype:

var txt = "Hello World!";
document.write(txt.constructor);

The above example outputs:

function String() { [native code] }

JavaScript String Object

❮ Jsref Tanh Dom Obj Week ❯