What's the difference between Object.prototype.toString and Object.toString?

when judging the parameter type today, we found that
Object.prototype.toString.call (param) can, and
Object.toString.call (param) cannot.
the error message is
Function.prototype.toString requires that "this" be a Function.
but the output of the two functions on the console should look the same. Excuse me, why is this?
clipboard.png

Mar.19,2021

Object constructor itself does not have a toString method.
according to the prototype chain relationship, the upstream prototype chain of the Object constructor is Function.prototype .
so, when you call Object.toString.call (param) , you essentially call Function.prototype.toString.call (param) . The parameter type required here is function , and you pass the object , so you will report an error.

Menu