0

guys i want to know is there any different between this anonymous :

first :

(function(){ //statements })(); 

second :

(function(){ //statements }()); 

third :

!function(){ //statmeents }(); 

i need a clear explanation about this , thanks all :D

1

1 Answer 1

2

The one and only difference is that the last variation uses fewer bytes.

All three use the language's syntax rules to force the function to be a function expression (which can be immediately invoked) rather than a function declaration (which cannot be invoked, must be named, and is subject to hoisting).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.