String.prototype 指向原型对象,所以 typeof String.prototype === "object"
;
Function 作为内置方法,Function.prototype === Function
指向它本身,还是一个函数,所以 typeof Function.prototype === "function"
String.constructor === Function // true
function Obj(name) {
this.name = name;
}
Obj.constructor === Function // true
// Function 的构造函数指向它本身,即 Function [native code]
Function.constructor === Function // true
谢谢,第一个问题回答的太好了,但是第二个问题是没答案,还是我没在你答案中找到答案
@JS初学: 『 Function.prototype === Function
指向它本身,』 错了,应该是Function.constructor === Function
看这张图应该可以了解: