Create Array of Current Year and Last Year Angular

I am trying to create an Array of Years. Current year and Last Year. The following code is working however I wanted to see if there is a cleaner way of doing this?

var d = new Date();
    var currentYear = (d.getFullYear());
    var lastYear = (d.getFullYear() - 1);

    $scope.years = [
        currentYear,
        lastYear
    ];

Answer

Try this

   var d = new Date();
   var currentYear = d.getFullYear();
   var lastYear = currentYear - 1;
   $scope.years = [currentYear,lastYear];