详解jQuery中的isPlainObject()使用方法

2020-05-27 18:00:00易采站长站整理

Function 对象覆盖了从 Object 继承来的 Object.prototype.toString 方法。
函数的 toString 方法会返回一个表示函数源代码的字符串。具体来说,包括 function关键字,形参列表,大括号,以及函数体中的内容。


function fn(said){
this.say = said;
}

Function.prototype.toString.call(fn);
//"function fn(said){
// this.say = said;
//}"

Function.prototype.toString.call(Object);
//"function Object() { [native code] }"