Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

经过测试

function fn(){}
console.log(fn.__proto__===Function.prototype)
// true
console.log(typeof Function.prototype)
//function

Function.prototype 是一个函数,既然是函数那么他也应该有自己的原型对象,因此 Function.prototype.prototype 应该是一个对象或者函数,但是测试后发现是 undefined
求大佬解答~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/instanceof

Function.prototype  instanceof Function 
false
Function  instanceof Function 
true

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...