title: Why isn't it a must to declare a variable in Javascript before using it?
body: <p>In Javascript we don't have to declare a variable with <code>var</code> keyword before using it. We can straight away do things like <code>myCount = 12;</code> or <code>myStr = "Hello";</code> (where myCount, myStr are not declared before). Any such usage, declares and initializes the variables in the 'global' scope. </p>
  
  <p>What could be the reasons for providing this feature? And is it a good standard at all?</p>
  
  <p><strong>UPDATE:</strong> My question is not what the differences are between 'using a variable without declaring' and 'declaring and then using' and how it affects scope.</p>
  
  <p>My question is 'why it is allowed in javascript to use a variable directly without declaring it' as most of the programming languages have a strict check on this.</p>
  
  <p><strong>UPDATE</strong> : I see the following quoted text as a bad effect of this feature. So, why have this feature at all?</p>
  
  <p>"Suppose there is a globally declared variable <code>x</code> (<code>var x="comparison string"</code>) already which i am unaware of and i with intention of creating my own global 'x' inside one of my functions initialize one(<code>x=-1</code>) and there i end up breaking other functionality. </p>
  
  <p>So, is there any good reason at all? for having this feature?</p>