Returns the index of the candidate whose distance to target is smallest, or -1 when candidates is empty. Ties resolve to the lowest index. All candidates must be the same Temporal type as target.
target
-1
candidates
Returns the index of the candidate whose distance to
targetis smallest, or-1whencandidatesis empty. Ties resolve to the lowest index. All candidates must be the same Temporal type astarget.