// a self-invoking anonymous function
(function() {})();
Is it the same as the following?
// as in underscore.js (underscorejs.org)
(function() {}).call(this);
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.
No, the second one will set the calling context of the function to the same value as the outer context.
The first one may or may not have the same context, depending on where this code is run, and whether or not your code is running in strict mode.