Skip to main content

compareBlockNumbers

Callable


  • Compares between block A and block B

    @example
    console.log(web3.utils.compareBlockNumbers('latest', 'pending'));
    > -1

    console.log(web3.utils.compareBlockNumbers(12, 11));
    > 1

    Parameters

    Returns -1 | 0 | 1

    • Returns -1 if a < b, returns 1 if a > b and returns 0 if a == b