• Parameters

    • array: any[]

      an array that is meant to be thought of as circular

    • indices: [number, number]

      two numbers these indices will divide the array into 2 parts

    Returns [any[], any[]]

    the input array split into two arrays

    Description

    A circular array (data wraps around) requires 2 indices if you intend to split it into two arrays. The pair of indices can be provided in any order, they will be sorted, smaller index first.