Function isSurahAyahJuzFirst

  • Determines if a given Surah and Ayah combination marks the beginning of a Juz.

    Parameters

    • surah: Surah

      The Surah number to check

    • ayah: AyahNo

      The Ayah number within the Surah to check

    Returns number

    The Juz number if the combination marks the start of a Juz, -1 otherwise

    Error When the provided Surah number is invalid

    isSurahAyahJuzFirst(2, 142) // Returns 2
    isSurahAyahJuzFirst(2, 143) // Returns -1