String是字符串对象的构造函数.所有构造函数都是函数,因此是您看到的返回值.
你可以通过创建这样的代码来自己看到:
var MyObject = function (value) {
this.value = value;
};
MyObject.prototype.getValue = function () {
return this.value;
}
console.log(typeof(MyObject)); // function
console.log(typeof(new MyObject(1))); // object
Run Code Online (Sandbox Code Playgroud)