I'm new in JavaScript and I want to understand something, for example in jQuery we have the jQuery object (often called $), but I'm confused here:
In jQuery when we want to select DOM nodes, we use jQuery selector, for example like this:
$('div');
But when we want to make a post to a server we call it like:
$.post({...});
My question is, how an object can behave like a function and an object at the same time? When I use $('div'), I'm calling a function and when I'm using $.post({...}) I'm accessing a function inside an object.
$- not an object, this a function.$is an object and a function$is afunction. this enough :-)