JavaScript constructorProperty

String 对象参考手册JavaScript String Object


Definition and Usage

The constructor property returns the function created for the String object property.

Syntax

string.constructor


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the constructor property.


Example

Example

Returns the function created for the String object property:

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

The above example outputs:

function String() { [native code] }

Try it Yourself »


String 对象参考手册JavaScript String Object

Other Extensions