temporal-fns
    Preparing search index...

    Function closestTo

    • Returns the candidate whose distance to target is smallest, or null when candidates is empty. Ties resolve to the earliest candidate.

      Type Parameters

      Parameters

      • target: T
      • candidates: T[]

      Returns T | null