Why this line is executing in javascript?
<p>Got a query from a collegue. I am not able to answer this question.</p>

<pre><code>var x = '9'; // Line no 1
x=='7' // Line no 2
//doing something with x
</code></pre>

<p>Line no 2 is not giving any error.</p>

<p>another scenario</p>

<pre><code>var x == '7';
</code></pre>

<p>Browser :
    SyntaxError: missing ; before statement</p>

<p>This is because the assignment is always done by single '='.</p>

<p>Question :</p>

<ol>
<li>How first scenario executes?</li>
</ol>
