// Objects with prototype are plain iff they were constructed by a global Object functionCtor = hasOwn.call( proto, "constructor" ) && proto.constructor; //這行是什么意思?return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;以下是上訴代碼中提到的代碼jQuery 3.2.1 中,判定對象是否為純對象的函數(shù),最后兩行,我自己測試的時候是不對等的,想問下問題在哪里問下為什么輸出結(jié)果是 falseObject.hasOwnProperty.call(proto, "constructor") && proto.constructor; 是什么意思Object.hasOwnProperty.toString.call( Object ) 輸出為function Object() { [native code] }Object.hasOwnProperty.toString.call( Number )輸出為function Number() { [native code] }是為什么
關(guān)于 jQuery 源碼中的 isPlainObject 函數(shù)判定對象是否為純對象的問題
至尊寶的傳說
2018-11-23 19:19:16