Skip to content
Advertisement

How to check if string matches any of the strings in the database

I’m trying to check if string matches any of the strings saved in database, but with the code I have right now it checks only the first one My code:

JavaScript

Advertisement

Answer

You should not return if the key does not match as you want to continue comparing keys. Something like:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement