What is the best method of searching through an array for individual characters and returning true if found and false if not using JS?
For example:
search["adipisci","adipiscix"]
returns false in array element 1 and true in array element 2 when “sciipx” is searched
Many thanks!
The following should do the trick:
In the end matches will be an array with indexes of strings that matched.
Here’s the fiddle: http://jsfiddle.net/W3Xvy/
NB: If you need it, the loops can be further optimized.