title: Increment value each time when you run function
body: <p>So I need a function which increments the value of a variable say n=0. When ever the function runs, the value of this varible must be incremented and it should not be equal to 0 again. For example consider the following code :</p>
  
  <pre><code>function increment(){
    var n = 0;
    n++;
    return n;
  }
  </code></pre>
  
  <p>Now everytime you run this function you get a value of 1. But my requirement is if you run this function for the 1st time, it should be 1, if you run it for the second time, it should be 2 and so on. Unless you refresh the html page and run the function again, it should not be equal to 0. Can anybody help me?</p>
  
  <p>I'm new to coding and any small help is appreciated. Thanks in advance!!!</p>