I have a list of strings such as
const myCategories = ["Alligator", "Rhyno", "Elephant"]
And I want to get the best match for the string which I provide as input, for example
const userInput = "elep"
return myCategories.find(category => category.test(userInput))
However this does not work as I expect.
I need this to return a category even with a partial match, for example, if i write "eph", I should get "Elephant", or "rho" I should get "Rhyno"