Latest web development tutorials

JavaScript constructor property

String Object Reference JavaScript String Object

Definition and Usage

constructor property returns function String object properties created.

grammar

string.constructor


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute constructor


Examples

Examples

Returns a String object function attributes created:

<script>

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

</script>

The above example output:

function String() { [native code] }

try it"


String Object Reference JavaScript String Object