I feel like I've only ever seen this here on SO, but I can't seem to find any documentation on it. The code I am talking about is stuff like this:
$(function foo(){
alert('foo');
});
Is there anything to that or is that just something that novices do because they think jQuery is a language? There is no scope change. It just seems completely unnecessary. Is there any method that you can invoke on this like:
$(function foo(){ alert('foo'); }).someMethod();
The closest thing I can think of is $.proxy, but that doesn't use this syntax. Am I right, is this completely unnecessary?