In JavaScript, why typeof Function.prototype is “function”, not “object” like other prototype objects?

前端 未结 4 536
天涯浪人
天涯浪人 2020-11-27 07:05
console.log(typeof String.prototype); // object
console.log(typeof Number.prototype); // object
console.log(typeof Object.prototype); // object
console.log(typeof Bo         


        
4条回答
  •  借酒劲吻你
    2020-11-27 07:57

    Since it has all the methods and props that any function is ought to have, this makes it effectively a function ...

    Think about it for a moment and let it sink and you'll get the picture by then :)

提交回复
热议问题