var yearStart = 2000; var yearEnd = 2040; var arr = []; for (var i = yearStart; i < yearEnd+1; i++) { arr.push(i); }