Daniel Contreras Daniel Contreras - 1 year ago 91
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

Answer Source

$.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"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download