javascript - How does jQuery makes the jQuery object both a function and an object property? -
i've been wondering long time how jquery can both function , object property.
you can use function, jquery(...) , can use property jquery.ajax(...)
how can achieve such thing in javascript?
functions objects in javascript. can have main function
var $ = function() { alert('wat'); }
and extend it
$.fadeto = function() { alert('fadeto'); }
Comments
Post a Comment