Function isEven

  • Function isEven checks passed number's parity and returns true, if number is even.

    Remarks

    Applications to check number's parity are very common. This function therefore helps to correctly check for all possible situations happening in JS world and returns true, when passed number is really Even.

    Example

    Basic usage of checking parinty by isEven function:

    import { isEven } from 'simple-mathematic';

    isEven(0); // true
    isEven(2); // true
    isEven(-10); // true

    isEven(1); // false
    isEven(2.5); // false
    isEven(Infinity); // false
    isEven(NaN); // false
    isEven(Number.MAX_SAFE_INTEGER); // false

    Parameters

    • number: number

      Integer number to be checked if is Even

    Returns boolean

    true value if passed argument is even integer number, false otherwise

Generated using TypeDoc