phaser - v4.0.0-rc.4
    Preparing search index...

    Function FindClosestInSorted

    • Searches a pre-sorted array for the closet value to the given number.

      If the key argument is given it will assume the array contains objects that all have the required key property name, and will check for the closest value of those to the given number.

      Parameters

      • value: number

        The value to search for in the array.

      • array: any[]

        The array to search, which must be sorted.

      • Optionalkey: string

        An optional property key. If specified the array elements property will be checked against value.

      Returns any