$('#foo').click(function(){ });
Is function(){ } an anonymous function, or a self-invoking function? And what would be the difference between the two?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A function with no name / reference is called as anonymous function. The function inside
$('#foo').click(function(){ });is an anonymous function.Self-invoking function is a function that is called right after it definition.
(function () { })();-> is a self-invoking function.