title: How to get Past 12months with year from current date
body: <p>I want to show the past 12 months but year is not appending with the list</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var theMonths = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var today = new Date();
  var aMonth = today.getMonth();
  var i;
  
  for (i = 0; i &lt; 12; i++) {
    document.writeln(theMonths[aMonth] + '&lt;br&gt;'); //here you can do whatever you want...
    aMonth++;
    if (aMonth &gt; 11) {
      aMonth = 0;
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I get the past 12 months with year from current month.</p>