With user input select the option with the closest spelling / Closest similar

Viewed 9

I am taking user input in node and I want it to be so if they spell the word wrong or it is not exactly correct it will default to the closest option. Ex. List: Diamond, Emerald, Ruby, Sapphire, Garnet, Barrel, Gemstone Study User input: Diamd = Diamond User input: Gemstone = Gemstone Study I want this so if the user is slightly incorrect when typing in what they are looking for it will automatically try to fix it.

0 Answers
Related