Is there any way to use Levenshtein Distance with an array
for example i have a div with multiple text
<div>one,two,three,longtext,anything</div>
and an input
<input type="text"> // sometext
What im trying to do is measure each one separated by comma with the text in the input. i have tried jquery .split() but it turns up undefined or im doing something wrong there.
You don’t need jQuery for everything. You can split a string using the native
s.split(","), wheresis the string you want to split.For example, provided the function
levenshteintakes two arguments and returns their levenshtein disttance, you could use the following code:HTML:
JS: