javascript increments misunderstanding
<pre><code>  &lt;/!DOCTYPE html&gt;
&lt;/html&gt;
&lt;/body&gt;

&lt;p&gt;Given that y=5, calculate x=++y, and display the result.&lt;/p&gt;
&lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;

&lt;p id="demo"&gt;&lt;/p&gt;

&lt;script&gt;
function myFunction()
{
var y=5;
var x=++y;
var demoP=document.getElementById("demo")
demoP.innerHTML="x=" + x + ", y=" + y;
}
&lt;/script&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Both variables, x and y, are affected.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;*/
</code></pre>

<p>Clearly, I'm a beginner but I have no one else to ask. It would be helpful if someone could explain the reason behind <code>demop.innerHTML="x=" + x + ", y=" +y;</code> in this code.</p>
