What does jQuery.fn mean?

前端 未结 4 1499
说谎
说谎 2020-11-22 09:03

What does the fn here mean?

jQuery.fn.jquery
4条回答
  •  旧时难觅i
    2020-11-22 09:44

    In the jQuery source code we have jQuery.fn = jQuery.prototype = {...} since jQuery.prototype is an object the value of jQuery.fn will simply be a reference to the same object that jQuery.prototype already references.

    To confirm this you can check jQuery.fn === jQuery.prototype if that evaluates true (which it does) then they reference the same object

提交回复
热议问题