TypeScript 字符串 构造器属性 返回一个引用到创建该对象的 String 函数。 示例 var str = new String( "This is string" ); console.log("str.constructor is:" + str.constructor)TypeScriptCopy 编译后,它将生成相同的JavaScript代码。 其输出如下: str.constructor is:function String() { [native code] }TypeScriptCopy