TypeScript - String Constructor Property



Returns a reference to the String 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] }
typescript_strings.htm
Advertisements