我想在我的函数检查中添加 notallowedcharacters 的功能,我该怎么做?
var userinput = prompt('Input characters:');
var lowercase = userinput.toLowerCase();
var allowedcharacters = ["a", "b", "c", "d", "e", "f"]
var notallowedcharacters = ["g-z"] && ["!","@","#","€","£","$","%","&","?","*","/","\","|",";",":","<",">","[","]","{","-","_","^","~","`","±","§"]
function match(input, statement) {
for (var i = 0; i < statement.length; i++) {
if (input.indexOf(statement[i]) == -1) {
return false;
}
}
return true;
}
if (match(lowercase, allowedcharacters)){
alert(true);
}
else{
alert(false);
}