@writetome51/is-leap-year
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.1 • Public • Published

    isLeapYear(year: number): boolean

    year must be a number.

    Examples

    isLeapYear(2020); // --> true
    
    isLeapYear(2021); // --> false
    
    isLeapYear(2024); // --> true
    
    isLeapYear(0); // --> true
    
    isLeapYear(1600); // --> true
    
    isLeapYear(1700); // --> false
    
    isLeapYear(996); // --> true
    
    isLeapYear(1000); // --> false
    
    isLeapYear(NaN); // --> false
    
    isLeapYear(''); // `Error: Input must be type 'number'`

    Installation

    npm i @writetome51/is-leap-year

    Loading

    import { isLeapYear } from '@writetome51/is-leap-year'; 

    Install

    npm i @writetome51/is-leap-year

    DownloadsWeekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    2.62 kB

    Total Files

    5

    Last publish

    Collaborators

    • writetome51