TypeScript - 字符串构造函数属性



返回创建对象的 String 函数的引用。

示例

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

编译后,它将在 JavaScript 中生成相同的代码。

其输出如下:

str.constructor is:function String() { [native code] }
typescript_strings.htm
广告

© . All rights reserved.