Same variable names in different JavaScript functions, considering one function calls the other
<p>I am doing a small work in <strong>JavaScript</strong> and I want to avoid problems, so I am asking beforehand.</p>

<p>Can I use two different variables and name them the same in different functions, given that one of these functions calls the other?</p>

<p>So, when I define the variable in the second function, will it interpret as two different variables, or will it rewrite the value of the original variable from the first function? (Or, will it throw an error due to the fact that a variable with that name already exists?)</p>

<p>Here is an example:</p>

<pre><code>function first()
{
var a = somevalue;
second();
}

function second()
{
var a = differentvalue;
}
</code></pre>

<p>Thanks!</p>
