Function closestString
- closest
String (givenWord, possibleWords, options?): string Parameters
- givenWord: string
The string to measure distance against
- possibleWords: readonly string[]
The string-array to pick the closest string from
Optionaloptions: ClosestStringOptionsThe options for the comparison.
Returns string
The closest string
- givenWord: string
Finds the most similar string from an array of strings.
By default, calculates the distance between words using the Levenshtein distance.