I am attempting to create a search function which should be able to find multiple file types given various search parameters.
For example i'd like to feed my application the following filter array ['.ini', '.exe', 'dsak_'] and compare each file found against that array to determine if the filename includes one of those strings
Currently I am using the following code
for(var i = 0; i < filter.length; i++){
if(file.includes(filter[i])) results.push(file);
}
But I was hoping to see if there was a better way to achieve this?