> 
> **Possible Duplicate:**  
> 
> [Difference between (function(){})(); and function(){}();](https://stackoverflow.com/questions/423228/difference-between-function-and-function) 
> 
> 
> 

I have seen it a lot by google: 

```
(function(){/*code*/})

```

Why they enclose their function inside the parethesis?
Which is the difference between:

```
function(){/*code*/}

```

?

Edit
====

Ok the questions should have been this:

Why they enclose their code into this:

```
(function(){/*code*/})();

```

Instead to write the code directly into the js flow?  

Are there any benefits, different behaviour?