title: Should I declare a variable inside a function or outside?
body: <p>I'm really bad a javascript please don't get me wrong if you find this question dumb;
  if I have two variables, should I have declared them inside or outside the function? </p>
  
  <p>like this</p>
  
  <pre><code>var Num = document.querySelector("#Fnumber");
  var Num2 = document.querySelector("#Secnumber");
  function Multiply(){
  alert(Num.value + Num2.value)
  }
  
  //or declaring variable inside a function like this ?
  
  function Multiply(){
  var Num = document.querySelector("#Fnumber").value;
  var Num2 = document.querySelector("#Secnumber").value;
  alert(Num + Num2)
  }
  </code></pre>
  
  <p>and am I pasting the value Property correct on both examples ?</p>