view raw
Daniel Contreras Daniel Contreras - 7 months ago 46
jQuery Question

In Javascript/JQuery what is $. for?

I'm writing a utility file and I've gotten some examples from online and this a form of writing the utility I've come across:

$.util = $.extend($.util || {}, {

//functions here...


and so I think I understand what it's doing. It allows me to call
somewhere else, however when I remove the
in front of the
the code breaks. What does this notation mean? What's the difference between


$.util = something means "assign something to property util of object $".

$util = something means "assign something to variable $util"

Similarly, $.extend is "get value of property extend of object $" (which is a function in this exact scenario) and $extend is "get value of variable $extend"