Nodejs Year Leap Check isLeapYear(year)

Here you can find the source of isLeapYear(year)

Method Source Code

//Leap year every 4 years... except when it isn't... except when it is
function {// w  w  w  .  ja v  a  2 s  .c om
  return year%4==0&&(year%100!=0||year%400==0);
}

Related

  1. isLeapYear()
    Date.prototype.isLeapYear = function () {
      return new Date(this.getFullYear(), 1, 29).getDate() == 29;
    };
    
  2. isLeapYear()
    Date.prototype.isLeapYear = function() {
      return Date.isLeapYear(this.getFullYear());
    };
    
  3. isLeapYear()
    Date.prototype.isLeapYear = function ()
        var y = this.getFullYear();
        return (((y % 4 === 0) && (y % 100 !== 0)) || (y % 400 === 0));
    };
    
  4. isLeapYear(year)
    Date.isLeapYear = function(year) {
      return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
    };
    
  5. isLeapYear(year)
    Date.isLeapYear = function (year)
        return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
    };