Last active
March 13, 2020 19:01
-
-
Save WouterNieuwerth/72a137c3bd97bb8b7d8afa8fa1dfd738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var search_terms = ['buy nike shoes','adidas online','rebok cloths']; // With some spelling errors | |
var brands = ['nike','adidas','reebok']; | |
for (var i=0; i<search_terms.length; i++) { | |
for (var j=0; j<brands.length; j++) { | |
if(search_terms[i].indexOf(brands[j]) !== -1) { | |
// Do whatever you want to do when the search term contains a brand name | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment