lets say I have an array of filter strings that I need to loop and check against with other passed in string.
var filterstrings = [\'firststring\',\'secondst
ES6 array method filter() can simply the solution in single line, use includes() method to determines whether an array includes a certain value among its entries.
var filterstrings = ['firststring','secondstring','thridstring'];
var passedinstring = localStorage.getItem("passedinstring");
// convert each string from filterstrings and passedinstring to lowercase
// to avoid case sensitive issue.
filteredStrings = filterstrings.filter((str) => str.toLowerCase().includes(passedinstring.totoLowerCase())