how to check file name?

how to check file name?

hi guys need some help. i have written a code that checks now if i have uploaded 2 file with the name which have been defined. but now i would like to check for each file name and show an alert message to the user which file name is missing. 

                        var files = $('#file').prop("files");
                        var fileNames = $.map(files, function(val){ return val.name; });

                        var toCheck = ["Query", "Entities"];
$.each(fileNames, function (i, name){
var Filename = name.replace(/\..+$/, '');
toCheck = jQuery.grep(toCheck, function(value) {
return value != Filename;
})
});
if (toCheck.length > 0) {
alert('You will need to rename the files to Query and Enitites');
}

so now i would like to check if the user have uploaded an Query and Entities file name or not. and show an alert message to which specific file name is not exist