These codes seem to work the same way:
Hello world
(
function(a)
{
alert(a);
}
)('Hello');
Another hello world
(
function(a)
{
alert(a);
}('Hello')
);
Is there any differences actually?
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. Given the code exactly as you’ve posted it, there is no effective difference. Both forms construct the same anonymous function and subsequently call that function with the same argument.