jQuery function source code -


jquery 1.4.2 in ie 8

when call $.isfunction(function() {}) returns true.
source code isfunction function:

    isfunction: function (obj) {         return tostring.call(obj) === "[object function]";     }, 

when write in console tostring.call(function() {}) === "[object function]" throws "object doesn't support property or method".

source code of minified version:

isfunction:function(a){return $.call(a)==="[object function]"} 

when write in console $.call(function() {})==="[object function]" returns false.
why code works in different ways?

at top of jquery 1.4.2 source (inside wrapper), tostring defined object.prototype.tostring. global tostring function different prototyped tostring method, hencethe different results.

// save reference core methods tostring = object.prototype.tostring, 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -