TypeScript – String Constructor Property

String constructor

Returns a reference to the String constructor function that created the object.

Example

var str = new String( "This is string" ); 
console.log("str.constructor is:" + str.constructor)

On compiling, it will generate the same code in JavaScript.

Its output is as follows −

str.constructor is:function String() { [native code] }

Previous Page:-Click Here

This Post Has 2 Comments

Leave a Reply