primitives as function arguments in javascript
<p>I'm learning JS here, and have a question regarding primitive values when passed in as arguments. Say I have a simple function: </p>

<pre><code>var first= 5;
var second= 6;

function func(){

first+=second;

}
func();
alert(first);//outputs 11
</code></pre>

<p>So in this case the value of first becomes 11.. But if I try it by passing in first as an argument to the function, first remains 5..</p>

<pre><code>var first= 5;
var second= 6;

function func(first){

first+=second;

}
func(first);
alert(first);//outputs 5
</code></pre>

<p>wondering if someone could explain this to me.</p>
