I am debugging someone else's JavaScript code and a majority of the code is wrapped like this:
(function ($) {
//majority of code here...
})(jQuery);
What is going on with the ($) and the (jQuery)? I wasn't taught to code like that and haven't seen them. What is their purpose?
As well, there is no document.ready, but I assume that is because the code is executed right after it's read by the (); at the end?