JSFiddle - React, Tailwind, and code Playground

JavaScript

var testAgainst = ['and','+',',','&'];
var toTest = ['This is just a test +','This is just a test and','This is just a test ,','This is just a test &','This is just a test'];

for(var i = 0; i < testAgainst.length; i++){

    if (toTest[0].indexOf(testAgainst[i]) > -1){
        console.log('match: ' + testAgainst[i]);
    }else{
        console.log('no match');
    }

}