I understand that the following is shorthand for $( document ).ready()
:
$(function() {
console.log( ready! );
});
I also understand what an anonymous JS function is, but does jQuery does anything special when it's called using one. I.e.:
(function() {
console.log( ready! );
})($);
Is the latter just a normal anonymous JS function that uses jQuery (ie. it will NOT be considered shorthand for $(document).ready()
and so will execute immediately)?
I feel this MUST have been asked before, but I can't find it if it has.