closestTo method
The closest element E to target.
Example:
<Note>[.c, .e, .f.sharp, .a].closestTo(.g) == .f.sharp
Implementation
E closestTo(E target, [num Function(E a, E b)? difference]) =>
_closestTo(target, difference ?? _difference);
The closest element E to target.
Example:
<Note>[.c, .e, .f.sharp, .a].closestTo(.g) == .f.sharp
E closestTo(E target, [num Function(E a, E b)? difference]) =>
_closestTo(target, difference ?? _difference);