Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-leap-year/docs/types/index.d"

Index

Functions

Functions

Export assignment isLeapYear

  • isLeapYear(value?: any): boolean
  • Tests whether a value corresponds to a leap year in the Gregorian calendar.

    Notes

    • According to the Gregorian calendar, every year that is exactly divisible by 4 is a leap year, except those years which are also divisible by 100 and not by 400 (e.g., 1900).

    Parameters

    • Optional value: any

      input value

    Returns boolean

    boolean whether a value corresponds to a leap year

    Example

    var bool = isLeapYear();
    // returns <boolean>

    Example

    var bool = isLeapYear( new Date() );
    // returns <boolean>

    Example

    var bool = isLeapYear( 1996 );
    // returns true

    Example

    var bool = isLeapYear( 2001 );
    // returns false