title: Range of Years in JavaScript for a select box
body: <p>I'm trying to create a dynamic select box in JavaScript with a range of years starting with 'some' year and ending with the current year. Is there anything like Ruby's <a href="http://www.ruby-doc.org/core/classes/Range.html" rel="noreferrer">range</a> class in JavaScript or do I have to loop trough the years using a for loop? </p>
  
  <p>Here's what I've come up with though I think it's a bit much considering in Ruby I can just use a range. </p>
  
  <pre><code>    this.years = function(startYear){
          startYear = (typeof(startYear) == 'undefined') ? 1980 : startYear
          var currentYear = new Date().getFullYear();
          var years = []
          for(var i=startYear;i&lt;=currentYear;i++){
              years.push(i);
          } 
          return years;
      }
  </code></pre>