0
Hello! I am trying to make a code that allows checking if a given email and password are within certain arrays, so far this code works, however I can’t make the code detect errors like: if the email is in the array but does not match the password, thus releasing an Alert.
function Entrada_login() {
            var password = document.getElementById("Password").value;
            var email = document.getElementById("Email").value;
            for (var i = 0; i < emails.length; i++) {
                if ((email == emails[i]) && (password == passwords[i])) {
                    i = i;
                    alert("funciona");
                    break;
                }
            }
        } 
Thank you!!
Could you ask the question array who makes the comparisons!
– LeAndrade