title: Difference between local and global variables in javascript?
body: <p>I noticed that in JavaScript, Inside  a function some times a variable created without mentioning <code>var</code> before it.</p>
  
  <p>For example :    </p>
  
  <pre><code>function myfunction() {
       x = 10;
       var y = 10;
  }
  </code></pre>
  
  <p>what is the difference between these both? </p>